Skip to content

Instantly share code, notes, and snippets.

@tdowling
Forked from bidulock/.psqlrc
Created October 8, 2013 20:47
Show Gist options
  • Save tdowling/6891366 to your computer and use it in GitHub Desktop.
Save tdowling/6891366 to your computer and use it in GitHub Desktop.
-- Include the hostname in the prompt, and add a * when in a transaction
-- The default PROMPT2 doesn't make it obvious enough nothing has been sent to the server yet
\set PROMPT1 '%M:%/%R%x%# '
\set PROMPT2 '> '
-- Always be in a transaction. It's safer this way
\set AUTOCOMMIT off
-- Turn the pager on always. This is best used with "export PAGER=less -S -F -X" added to your .bashrc
\pset pager always
-- History files stored in the .psql_history directory in the form <hostname>-<dbname>
\set HISTFILE ~/.psql_history/:HOST - :DBNAME
\set HISTSIZE 2000
-- Always display timing information.
\timing
\encoding unicode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment