-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_psqlrc.tmpl
More file actions
49 lines (38 loc) · 1.2 KB
/
dot_psqlrc.tmpl
File metadata and controls
49 lines (38 loc) · 1.2 KB
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
-- https://thoughtbot.com/blog/improving-the-command-line-postgres-experience
\echo `date --iso-8601=sec`
set application_name to {{ .chezmoi.username }}_psql;
set bytea_output to hex;
SET plpgsql.extra_warnings TO 'shadowed_variables';
select name,setting from pg_settings where name in ('cluster_name','bytea_output','application_name','plpgsql.extra_warnings');
-- transaction settings
\set AUTOCOMMIT off
\set ON_ERROR_ROLLBACK interactive
-- Ctrl-D after 5 tries
\set IGNOREEOF 5
-- Autocomplete keywords (like SELECT) in upper-case, even if you started
-- typing them in lower case
\set COMP_KEYWORD_CASE upper
-- Use a separate history file per-database
\set HISTFILE ~/.cache/psql/history- :DBNAME
\set HISTSIZE 10000
-- If a command is run more than once in a row, only store it once in the history
\set HISTCONTROL ignoredups
-- prompts
\set PROMPT1 '%n@%M:%>/%/%x%# '
\set PROMPT2 '[more] %R > '
-- Verbose error reports.
\set VERBOSITY verbose
-- result settings
\pset null '⓿⓪⓿⓪'
\pset linestyle 'unicode'
\pset border 2
\x auto
-- pager settings
\setenv PAGER less
\setenv LESS -XFSM
\setenv PG_COLOR 'auto'
\pset pager always
\pset format wrapped
\pset columns 0
-- turn on timing output
\timing