List of tips:
- Show date on startup
- Be verbose about feeback
- Set all null fields to NULL
- Turn off the pager so that results keep scrolling by, rather than stopping
- Set the command history files for each host and database
- Set the number of commands to store in the command history
- Set timing on and show how long it takes to run each query
Configure .psqlrc as follows:
\echo `date +"%Y-%m-%d %H:%M:%S"`
\set VERBOSITY verbose
\pset null 'NULL'
\pset pager off
\set HISTFILE ~/.psql_history- :HOST - :DBNAME
\set HISTSIZE 2000
\timing
One additional tip is to add less to PAGER environment variable if you want to use less rather than more. Add the following to profile ~/.profile or /etc/profile
export PAGER=less