Add config for psql

This commit is contained in:
Alexander Hess 2022-07-12 02:37:04 +02:00
parent c5cf44f72e
commit c1393d0756
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
3 changed files with 33 additions and 1 deletions

View file

@ -20,7 +20,7 @@ git clone --bare git@git.webartifex.biz:alexander/dotfiles.git "$HOME/.dotfiles"
# Backup old dotfiles
rm -rf "$HOME/.dotfiles.bak" >/dev/null
mkdir -p $HOME/.dotfiles.bak/.config/{bat,flameshot,git,Nextcloud,pop-system-updater,shell} && \
mkdir -p $HOME/.dotfiles.bak/.config/{bat,flameshot,git,Nextcloud,pop-system-updater,psql,shell} && \
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
xargs -I{} mv {} "$HOME/.dotfiles.bak"/{}

View file

@ -34,6 +34,8 @@ export BAT_CONFIG_PATH="$HOME/.config/bat/config"
export LESSHISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/.lesshst"
export PSQLRC="$HOME/.psqlrc"
# Shell-specific stuff

30
.psqlrc Normal file
View file

@ -0,0 +1,30 @@
-- `psql` executes the commands in this `~/.psqlrc` 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, NULLs show up as empty spaces, which looks like empty strings
\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 the best text editor in the world
\set EDITOR vi
-- 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