Skip to content

Instantly share code, notes, and snippets.

@yanmhlv
Last active November 13, 2020 13:30
Show Gist options
  • Save yanmhlv/d929f652e025fcf069ee78f3550e584c to your computer and use it in GitHub Desktop.
Save yanmhlv/d929f652e025fcf069ee78f3550e584c to your computer and use it in GitHub Desktop.
coloured PROMPT for psql
\x auto
\timing on
SET work_mem='512MB';
SET maintenance_work_mem='1GB';
-- Nicer PSQL prompt
-- Prompt1 / Prompt2
-- %M : server
-- %m : host name
-- %> : port
-- %n : user
-- %/ : current database
\set PROMPT1 '%M:%[%033[1;31m%]%>%[%033[0m%] %n@%/%R%#%x '
\set PROMPT2 '%M %n@%/%R %# '
\set HISTFILE ~/.psql_history- :DBNAME
\set HISTCONTROL ignoredups
\set QUIET OFF
\set VERBOSITY verbose
PSQLRC=~/.psqlrc_prod \
psql
PSQLRC=~/.psqlrc \
psql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment