]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - misc/psql/psqlrc.in
misc: psql: improve comment
[config/dotfiles.git] / misc / psql / psqlrc.in
1 -- Postgresql client configuration file.
2
3 -- Copyright (C) 2016-2018  Simon Ruderich
4 --
5 -- This file is free software: you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation, either version 3 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This file is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this file.  If not, see <http://www.gnu.org/licenses/>.
17
18
19 -- Shut up \pset during this config script.
20 \set QUIET on
21
22 -- Automatically switch to vertical mode when the columns don't fit on screen.
23 \pset expanded auto
24
25 -- Use unicode characters for borders.
26 \pset linestyle unicode
27
28 -- Per default NULL values are not displayed, use a replacement string to
29 -- prevent mistaken them for an empty string.
30 \pset null 「NULL」
31
32 -- Don't abort transactions in interactive mode when an error occurs. As the
33 -- error is displayed no information is lost and this saves one from having to
34 -- restart the transaction on a typo in a statement.
35 \set ON_ERROR_ROLLBACK interactive
36
37 -- "ignorespace ignoredups"
38 \set HISTCONTROL ignoreboth
39 -- Set path to history file (database specific) and increase the size.
40 \set HISTFILE HISTFILE_PATH- :DBNAME
41 \set HISTSIZE 100000
42
43 -- Add transaction status (%x) to prompt; show database name in bold green.
44 \set PROMPT1 '%x%[%033[01;32m%]%/%[%033[00m%]%R%# '
45 -- Remove database from second prompt to make it easily distinguishable from
46 -- PROMPT1.
47 \set PROMPT2 '%x%R%# '
48
49 -- But display the normal psql welcome message.
50 \set QUIET off
51
52 -- vim: ft=sql