-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpsqlrc
More file actions
27 lines (19 loc) · 1.17 KB
/
psqlrc
File metadata and controls
27 lines (19 loc) · 1.17 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
\set QUIET yes
\set HISTCONTROL ignoredups
\set HISTFILE ~/.psql_history- :DBNAME
\set ON_ERROR_STOP 1
\set ON_ERROR_ROLLBACK interactive
SET client_min_messages = notice;
SET timezone TO 'America/New_York';
\set SHELLHOST `echo $host`
\set PROMPT1 '%[%033[0;35m%]%x%n@%m @%:SHELLHOST::%/%R%#%[%033[0;22m%] '
\set PROMPT2 '%[%033[0;35m%]%x%/%R#%[%033[0;22m%] '
\set COMP_KEYWORD_CASE upper
\pset linestyle unicode
\pset null '␀'
-- \pset pager always
\x auto
\timing
\set rtsize '(select table_schema, table_name, pg_relation_size( quote_ident( table_schema ) || \'.\' || quote_ident( table_name ) ) as size, pg_total_relation_size( quote_ident( table_schema ) || \'.\' || quote_ident( table_name ) ) as total_size from information_schema.tables where table_type = \'BASE TABLE\' and table_schema not in (\'information_schema\', \'pg_catalog\') order by pg_relation_size( quote_ident( table_schema ) || \'.\' || quote_ident( table_name ) ) desc, table_schema, table_name)'
\set tsize '(select table_schema, table_name, pg_size_pretty(size) as size, pg_size_pretty(total_size) as total_size from (:rtsize) x order by x.size desc, x.total_size desc, table_schema, table_name)'
\unset QUIET