Created
July 29, 2024 09:41
-
-
Save wsgac/0132760717b4f4b21ea407970c114a53 to your computer and use it in GitHub Desktop.
More reasonable PSQL config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got this config from a friendly DBA (thanks Roberto ❤️). It makes navigating DB structures from
psql
easier and more pleasant.