From 270453dbe0d55dc3b5558f3c6e26f01329b6a065 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Tue, 9 Aug 2022 01:21:46 +0200 Subject: [PATCH] Configure psql --- .profile | 2 ++ .psqlrc | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .psqlrc diff --git a/.profile b/.profile index a5d4c1e..18d3a97 100644 --- a/.profile +++ b/.profile @@ -11,6 +11,8 @@ export REPOS="$HOME/repos" export LESSHISTFILE="$HOME/.lesshst" +export PSQLRC="$HOME/.psqlrc" + prepend-to-path () { # if not already there diff --git a/.psqlrc b/.psqlrc new file mode 100644 index 0000000..dba5163 --- /dev/null +++ b/.psqlrc @@ -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