From 3172ab2478b25a5c8e273ae9c06c27e385482ffd Mon Sep 17 00:00:00 2001 From: Chris Coley <chris@codingallnight.com> Date: Wed, 6 Dec 2017 11:29:23 -0800 Subject: [PATCH] Adding a .psqlrc file --- install.sh | 6 ++++++ psqlrc | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 psqlrc diff --git a/install.sh b/install.sh index 12ff8c5..3fe44cd 100755 --- a/install.sh +++ b/install.sh @@ -65,3 +65,9 @@ ln -s $DOTFILES/git-prompt.sh ~/.git-prompt.sh +# PostgreSQL +if [ -h ~/.psqlrc ] +then rm ~/.psqlrc +else mv ~/.psqlrc{,.old} 2> /dev/null +fi +ln -s $DOTFILES/psqlrc ~/.psqlrc diff --git a/psqlrc b/psqlrc new file mode 100644 index 0000000..69515fc --- /dev/null +++ b/psqlrc @@ -0,0 +1,27 @@ +-- Don't show the contents of this file on psql startup +\set QUIET 1 + +-- Autocomplete keywords to uppercase +\set COMP_KEYWORD_CASE upper + +-- Create a separate history file for each database +\set HISTFILE ~/.psql_history-:DBNAME + +-- Ignore duplicate history entries +\set HISTCONTROL ignoredups + +-- Force NULL to display as a character instead of empty +\pset null ยค + +-- Show how long each query takes to execute +\timing on + +-- Use horizontal/vertical column output based on content +\x auto + +\unset QUIET + +-- Useful aliases +\set version 'SELECT version();' +\set extensions 'SELECT * FROM pg_available_extensions;' +\set whoami 'SELECT CURRENT_USER;' -- GitLab