/
psqlrc
36 lines (26 loc) · 1.13 KB
/
psqlrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- Don't display the "helpful" message on startup.
\set QUIET 1
-- http://www.postgresql.org/docs/9.3/static/app-psql.html#APP-PSQL-PROMPTING
\set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%# '
\set PROMPT2 '[more] %R > '
-- Use table format (with headers across the top) by default, but switch to expanded table format when there's a lot of data, which makes it much easier to read.
\x auto
-- Use unicode characters and table frame to draw tables
\pset linestyle unicode
\pset border 2
-- Show how long each query takes to execute
\timing
-- Show NULL values as special Unicode symbol, that is unlikely to show up in any text stored in the DB
\pset null ¤
-- Wrap long lines to fit their column widths
\pset format wrapped
-- Use best available output format
\set HISTFILE ~/.psql_history- :DBNAME
\set HISTCONTROL ignoredups
-- Autocomplete keywords (like SELECT) in upper-case, even if you started typing them in lower case.
\set COMP_KEYWORD_CASE upper
\unset QUIET
\set VERBOSITY verbose
-- if psql can't check for a file's existence, provide an empty local
-- file that users can override with their custom dotfiles.
\i ~/.psqlrc.local