X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=psql%2Fpsqlrc.in;h=130215ca9b27090af6d3fbf55d38b43a0c5ce0fd;hb=c51602795d8c791487337a610aee1cf2af9c34d4;hp=8733b4f284752362cb242d5bde8d41bf2b3b2a36;hpb=8a793a31d6328feb328a501ab3222add8f0bb903;p=config%2Fdotfiles.git diff --git a/psql/psqlrc.in b/psql/psqlrc.in index 8733b4f..130215c 100644 --- a/psql/psqlrc.in +++ b/psql/psqlrc.in @@ -25,6 +25,15 @@ -- Use unicode characters for borders. \pset linestyle unicode +-- Per default NULL values are not displayed, use a replacement string to +-- prevent mistaken them for an empty string. +\pset null ï½¢NULLï½£ + +-- Don't abort transactions in interactive mode when an error occurs. As the +-- error is displayed no information is lost and this saves one from having to +-- restart the transaction on a typo in a statement. +\set ON_ERROR_ROLLBACK interactive + -- Uppercase keywords when completing. Thanks to [1] (read on 2016-08-06). -- [1]: http://phili.pe/posts/postgresql-on-the-command-line/ \set COMP_KEYWORD_CASE upper @@ -35,5 +44,11 @@ \set HISTFILE HISTFILE_PATH \set HISTSIZE 100000 +-- Add transaction status (%x) to prompt; show database name in bold green. +\set PROMPT1 '%x%[%033[01;32m%]%/%[%033[00m%]%R%# ' +-- Remove database from second prompt to make it easily distinguishable from +-- PROMPT1. +\set PROMPT2 '%x%R%# ' + -- But display the normal psql welcome message. \set QUIET off