Skip to content

Instantly share code, notes, and snippets.

@etiennebr
Last active February 23, 2023 11:09
Show Gist options
  • Save etiennebr/757442caacd81da2fd4dc8de75383401 to your computer and use it in GitHub Desktop.
Save etiennebr/757442caacd81da2fd4dc8de75383401 to your computer and use it in GitHub Desktop.
psql defaults
-- Adapted from http://www.craigkerstiens.com/2015/12/29/my-postgres-top-10-for-2016/
\set QUIET 1
\pset null '¤'
-- Customize prompts
\set PROMPT1 '%[%033[1;34m%][%M %n@%/] # %[%033[0m%]%'
\set PROMPT2 '... # '
-- Show how long each query takes to execute
\timing
-- Use best available output format
\x auto
\pset border 1
\pset footer
\pset format wrapped
\set VERBOSITY verbose
\set HISTFILE ~/.psql_history- :DBNAME
\set HISTCONTROL ignoredups
\set COMP_KEYWORD_CASE lower
\unset QUIET
\encoding utf8
-- can be used to view queries with \d...
--\set ECHO_HIDDEN on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment