diff --git a/install.sh b/install.sh index 12ff8c5d7d8151a690231fb8fe8d24c9ba4e86d9..3fe44cd8f8b007e6d170d091439b5a1dd7368edd 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 0000000000000000000000000000000000000000..69515fc6d81f0e3131c87d77a05c9865ff9130ac --- /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;'