Permalink
Browse files

Add psqlrc

  • Loading branch information...
Gabe Berke-Williams
Gabe Berke-Williams committed Jan 24, 2014
1 parent 294f962 commit 4cdd718c4c87705c7876391e769eda9b3d0d2eda
Showing with 23 additions and 0 deletions.
  1. +23 −0 psqlrc
View
23 psqlrc
@@ -0,0 +1,23 @@
+-- Official docs: http://www.postgresql.org/docs/9.3/static/app-psql.html
+-- Unofficial docs: http://robots.thoughtbot.com/improving-the-command-line-postgres-experience
+
+-- 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
+
+-- 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

0 comments on commit 4cdd718

Please sign in to comment.