Prettier psql Output with .psqlrc
I mostly use IntelliJ IDEA's Database tools for Postgres, but occasionally drop into psql.
The default output is ugly: misaligned columns, no borders, hard to read.
A few lines in ~/.psqlrc fixes it:
\set QUIET 1 \pset linestyle unicode \pset border 2 \pset null 'NULL' \timing on \x auto \set QUIET 0
linestyle unicode— clean box-drawing characters instead of+---+border 2— full border around resultsnull 'NULL'— makes NULLs visible instead of blank\timing on— shows query execution time\x auto— switches to expanded (vertical) format automatically when rows are wide
Drop it in ~/.psqlrc and it applies to every psql session automatically.
Full config: gist