]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - psql/psqlrc.in
psql: make PROMPT2 easily distinguishable from PROMPT1
[config/dotfiles.git] / psql / psqlrc.in
index 8396dfda4427eff38141b0220c73ba0f6dbd08de..ad37eaced6d8c98880030f2591f2820318cb9865 100644 (file)
 -- 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
@@ -41,7 +46,9 @@
 
 -- Add transaction status (%x) to prompt.
 \set PROMPT1 '%x%/%R%# '
-\set PROMPT2 :PROMPT1
+-- 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