Skip to content

Instantly share code, notes, and snippets.

@wsgac
Created July 29, 2024 09:41
Show Gist options
  • Save wsgac/0132760717b4f4b21ea407970c114a53 to your computer and use it in GitHub Desktop.
Save wsgac/0132760717b4f4b21ea407970c114a53 to your computer and use it in GitHub Desktop.
More reasonable PSQL config
-- prevent noisy loading of psqlrc file
\set QUIET yes
--customize prompt
\set PROMPT1 '\n%[%033[1;31m%]➤ %[%033[2;37m%]%`\! date "+%F %I:%M %p %Z"`%[%033[0m%] %[%033[1;36m%]%n%@%/%[%033[1;31m%]%x %[%033[K%]%[%033[0m%]\n%[%033[1;33m%]%R%#%[%033[0m%] '
\set PROMPT2 '%[%033[1;33m%]%R%#%[%033[0m%] '
--show timing info for queries
\timing
-- allow pasting of values to avoid stupid indenting
\set paste
--get rid of duplicates in history
\set HISTCONTROL ignoredups
\set HISTSIZE 5000
--set noisyness back to normal
\unset QUIET
@wsgac
Copy link
Author

wsgac commented Jul 29, 2024

I got this config from a friendly DBA (thanks Roberto ❤️). It makes navigating DB structures from psql easier and more pleasant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment