Add configuration for psql

This commit is contained in:
Alexander Hess 2025-08-30 11:53:13 +02:00
commit e7e42b93ef
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
3 changed files with 49 additions and 0 deletions

48
.config/psql/psqlrc Normal file
View file

@ -0,0 +1,48 @@
-- `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
-- 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
-- Make VI the default editor
\set EDITOR vi
-- Use separate history files per database
-- and keep them in one folder
\set HISTFILE ~/.local/state/psql/history- :DBNAME
-- Don't store the same SQL statement repeatedly
\set HISTCONTROL ignoredups
-- Make all queries display query times
\timing
-- Unset the flag set at the top of this file
\unset QUIET