-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.psqlrc
63 lines (44 loc) · 2.02 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
\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%]%# '
-- 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 > '
-- auto switch table formatting to best match terminal window size
\x auto
\encoding unicode
-- Do NOT automatically commit after every statement!
\set AUTOCOMMIT off
-- Be verbose about feedback
\set VERBOSITY verbose
-- Ensure autocompleted keywords stay uppercase
\set COMP_KEYWORD_CASE upper
-- Make history ignore all lines entered that were preceded by spaces, and ignore any entries that matched the previous line entered.
\set HISTCONTROL ignoreboth
-- Keep a different history file for each database name you log on to.
\set HISTFILE ~/.psql_history- :DBNAME
-- rollback failed transactions
\set ON_ERROR_ROLLBACK interactive
-- fail fast
\set ON_ERROR_STOP on
-- Show pretty unicode lines between rows and columns in select results.
\pset linestyle unicode
-- Show pretty lines around the outside of select results.
\pset border 2
-- Instead of displaying nulls as blank space, which look the same as empty strings (but are not the same!), show nulls as [NULL].
\pset null '(null)'
-- Turn off the pager so that results just keep scrolling by, rather than stopping.
\pset pager off
-- Within columns, wrap long lines so that select results still fit on the display.
\pset format wrapped
-- Show how long it takes to run each query.
\timing
\setenv EDITOR '/usr/local/bin/nvim'
-- Show the application_name in pg_stat_activity.
-- Good database citizens set this field so we know who to blame when a query hogs resources,
-- or somebody stays idle in transaction for too long.
set application_name to danethurber_laptop; commit;
-- Set bytea output to show as many ASCII letters as possible.
-- (Handy if you are storing text whose encoding you do not know in bytea columns.)
set bytea_output to escape; commit;
\unset QUIET