Add configuration for psql
This commit is contained in:
parent
1272f73dcd
commit
33d5bd7890
3 changed files with 48 additions and 0 deletions
47
.config/psql/psqlrc
Normal file
47
.config/psql/psqlrc
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
-- `psql` executes the commands in this file creating output
|
||||||
|
-- => This flag hides that and is unset again at the bottom
|
||||||
|
\set QUIET 1
|
||||||
|
|
||||||
|
|
||||||
|
-- Show verbose error messages
|
||||||
|
\set VERBOSITY verbose
|
||||||
|
|
||||||
|
|
||||||
|
-- Use normal "table" format by default
|
||||||
|
-- and "expanded table" with lots of columns
|
||||||
|
\x auto
|
||||||
|
\pset border 2
|
||||||
|
\pset linestyle unicode
|
||||||
|
|
||||||
|
|
||||||
|
-- By default, `NULL`s show up as empty spaces,
|
||||||
|
-- which may be confused with empty strings
|
||||||
|
-- => Show "NULL" instead for clarity
|
||||||
|
\pset null 'NULL'
|
||||||
|
|
||||||
|
|
||||||
|
-- Ignore errors in interactive sessions
|
||||||
|
-- but not when executing scripts
|
||||||
|
\set ON_ERROR_ROLLBACK interactive
|
||||||
|
|
||||||
|
|
||||||
|
-- Upper case SQL keywords
|
||||||
|
\set COMP_KEYWORD_CASE upper
|
||||||
|
|
||||||
|
|
||||||
|
-- Use separate history files per database
|
||||||
|
-- and keep them in one folder
|
||||||
|
\set HISTFILE ~/.local/state/psql/history- :DBNAME
|
||||||
|
\set HISTSIZE 999999
|
||||||
|
|
||||||
|
|
||||||
|
-- Don't store the same SQL statement repeatedly
|
||||||
|
\set HISTCONTROL ignoredups
|
||||||
|
|
||||||
|
|
||||||
|
-- Make all queries display query times
|
||||||
|
\timing on
|
||||||
|
|
||||||
|
|
||||||
|
-- Unset the flag set at the top of this file
|
||||||
|
\unset QUIET
|
||||||
|
|
@ -38,4 +38,5 @@ fi
|
||||||
|
|
||||||
export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config"
|
export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config"
|
||||||
export LESSHISTFILE="$XDG_STATE_HOME/less/history"
|
export LESSHISTFILE="$XDG_STATE_HOME/less/history"
|
||||||
|
export PSQLRC="$XDG_CONFIG_HOME/psql/psqlrc"
|
||||||
export VIMINIT='let $MYVIMRC="'"$XDG_CONFIG_HOME"'/vim/vimrc" | source $MYVIMRC'
|
export VIMINIT='let $MYVIMRC="'"$XDG_CONFIG_HOME"'/vim/vimrc" | source $MYVIMRC'
|
||||||
|
|
|
||||||
0
.local/state/psql/.gitkeep
Normal file
0
.local/state/psql/.gitkeep
Normal file
Loading…
Reference in a new issue