]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - psql/psqlrc.in
psql: add vim modeline
[config/dotfiles.git] / psql / psqlrc.in
index 8901fbfcab96c470bb0ae4ad01cc1f5d5cacc911..23cc2d94354312763ccfdcc74f5bd46929868c95 100644 (file)
 -- prevent mistaken them for an empty string.
 \pset null 「NULL」
 
--- 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
+-- 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
 
 -- "ignorespace ignoredups"
 \set HISTCONTROL ignoreboth
 \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
+
+-- vim: ft=sql