-
Notifications
You must be signed in to change notification settings - Fork 0
/
psqlrc
42 lines (30 loc) · 1.06 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
-- Don't show the contents of this file on psql startup
\set QUIET 1
-- Autocomplete keywords to uppercase
\set COMP_KEYWORD_CASE upper
-- Verbose error reports
\set VERBOSITY verbose
-- Create a separate history file for each database
\set HISTFILE ~/.psql_history- :DBNAME
-- Ignore duplicate history entries, and lines starting with a space
\set HISTCONTROL ignoreboth
-- Keep 2000 commands in history
\set HISTSIZE 2000
-- Force NULL to display as an ASCII 207 character instead of an empty space
\pset null ¤
-- Show how long each query takes to execute
\timing on
-- Use horizontal/vertical column output based on content
\x auto
-- Set the prompt
\set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%#%x '
\set PROMPT2 '[more] %R%# '
-- Useful aliases
\set version 'SELECT version();'
\set extensions 'SELECT * FROM pg_available_extensions;'
\set whoami 'SELECT CURRENT_USER;'
\unset QUIET
\echo 'PSQL resource file loaded.'
\echo 'NULL is displayed as "¤".'
\echo 'Type :version to see the PostgreSQL version.'
\echo 'Type :extensions to see the available extensions.\n'