]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - psql/psqlrc.in
psql: add transaction status to prompt
[config/dotfiles.git] / psql / psqlrc.in
index 8733b4f284752362cb242d5bde8d41bf2b3b2a36..8396dfda4427eff38141b0220c73ba0f6dbd08de 100644 (file)
 -- 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」
+
 -- 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 +39,9 @@
 \set HISTFILE HISTFILE_PATH
 \set HISTSIZE 100000
 
+-- Add transaction status (%x) to prompt.
+\set PROMPT1 '%x%/%R%# '
+\set PROMPT2 :PROMPT1
+
 -- But display the normal psql welcome message.
 \set QUIET off