From 72607c2d17bfde0edd1bd779b63b1516b82856b0 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sun, 26 Jun 2016 22:44:43 -0300 Subject: [PATCH] psqlrc improvements --- postgres/psqlrc.symlink | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/postgres/psqlrc.symlink b/postgres/psqlrc.symlink index 27144aeb90a..e24ea4c55a5 100644 --- a/postgres/psqlrc.symlink +++ b/postgres/psqlrc.symlink @@ -1,6 +1,29 @@ -\set COMP_KEYWORD_CASE upper -\x auto +-- Official docs: http://www.postgresql.org/docs/9.3/static/app-psql.html +-- Don't display the "helpful" message on startup. +\set QUIET 1 +\pset null '[NULL]' + +-- http://www.postgresql.org/docs/9.3/static/app-psql.html#APP-PSQL-PROMPTING +\set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%# ' +-- PROMPT2 is printed when the prompt expects more input, like when you type +-- SELECT * FROM. %R shows what type of input it expects. +\set PROMPT2 '[more] %R > ' + +-- Show how long each query takes to execute +\timing + +-- pager with less -SX \setenv PAGER 'less -SX' -\timing on -\pset null -- -\set PROMPT1 '%[%033[33;1m%]%x%[%033[0m%]%[%033[1m%]%/%[%033[0m%]%R%# ' + +-- Use best available output format +\x auto +\set VERBOSITY verbose +\set HISTFILE ~/.psql_history- :DBNAME +\set HISTCONTROL ignoredups +\set COMP_KEYWORD_CASE upper +\unset QUIET + +-- psql can't check for a file's existence, so we'll provide an empty local +-- file that users can override with their custom dotfiles. To set your own +-- personal settings, place your own file in ~/.psqlrc.local +\i ~/.psqlrc.local