-
Notifications
You must be signed in to change notification settings - Fork 0
/
psqlrc
40 lines (28 loc) · 915 Bytes
/
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
37
38
39
40
-- VIA: https://github.com/mitsuhiko/dotfiles/blob/master/psql/psqlrc
-- disable output temporarily
\set QUIET on
-- nicer rendering for null
\pset null '✗'
-- nicer tables
\pset linestyle unicode
-- enable timers
\timing
-- automatically switch to \x for large outputs
\x auto
-- wrap data cells that are too wide
\pset format wrapped
-- nicer prompt
\set PROMPT1 '\npsql %[%033[0;33;32m%]%/%[%033[0m%] on %[%033[0;33;33m%]%M:%>%[%033[0m%] as %[%033[0;33;35m%]%n%[%033[0m%] %[%033[0;33;36m%]%x%[%033[0m%]\n%R%# '
\set PROMPT2 '%R> '
-- better errors
\set VERBOSITY verbose
-- keep inputs in the history once
\set HISTCONTROL ignoredups
-- always auto complete in lowercase
\set COMP_KEYWORD_CASE lower
-- store a seperate history file for each host and database
\set HISTFILE ~/.psql_history- :HOST - :DBNAME
-- store a sensible amount of history
\set HISTSIZE 50000
-- output back on
\set QUIET off