-
Notifications
You must be signed in to change notification settings - Fork 0
/
psqlrc.symlink
45 lines (34 loc) · 1.29 KB
/
psqlrc.symlink
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
-- http://www.postgresql.org/docs/9.4/static/app-psql.html
-- Other good examples
-- https://gist.github.com/jaytaylor/e5aa89c8f3aaab3f576f
\pset linestyle unicode
\pset border 2
\pset format wrapped
\pset pager always
\x auto
\timing
-- Tab complete to upper case
\set COMP_KEYWORD_CASE upper
-- Stop invalidation of transaction on a query error
\set ON_ERROR_ROLLBACK on
-- Verbose error reports.
\set VERBOSITY verbose
-- Use a separate history file per-database.
\set HISTFILE ~/.psql_history- :DBNAME
-- If a command is run more than once in a row, only store it once in the
-- history.
\set HISTCONTROL ignoredups
-- Tab complete in upper case
\set COMP_KEYWORD_CASE upper
-- export YELLOW=`echo -e '\033[1;33m'`
-- export LIGHT_CYAN=`echo -e '\033[1;36m'`
-- export NOCOLOR=`echo -e '\033[0m'`
-- PAGER="sed \"s/\([[:space:]]\+[0-9.\-]\+\)$/${LIGHT_CYAN}\1$NOCOLOR/;"
-- PAGER+="s/\([[:space:]]\+[0-9.\-]\+[[:space:]]\)/${LIGHT_CYAN}\1$NOCOLOR/g;"
-- PAGER+="s/|/$YELLOW|$NOCOLOR/g;s/^\([-+]\+\)/$YELLOW\1$NOCOLOR/\" 2>/dev/null | less"
-- export PAGER
-- \setenv PAGER "/usr/bin/less --ignore-case --no-init --RAW-CONTROL-CHARS --quit-if-one-screen --chop-long-lines"
-- Approximate count:
-- SELECT reltuples::bigint AS estimate
-- FROM pg_class
-- WHERE oid = 'myschema.mytable'::regclass;