Skip to content

Commit

Permalink
psqlrc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jun 27, 2016
1 parent 51281de commit 72607c2
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions postgres/psqlrc.symlink
Original file line number Diff line number Diff line change
@@ -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<enter>. %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

0 comments on commit 72607c2

Please sign in to comment.