How can I customize the prompt in the PostgreSQL command line tool psql (ideally in a per-user start-up script)?
In particular, I’d like to be able to change it while still including the character that indicates whether the command is multi-line (eg. =, -, ', etc.).
I’m running Ubuntu 10.04 (Lucid), PostgreSQL 8.4.4.
You can certainly customize the prompt.
From the documentation:
If you want to set the prompt on a per user basis, you can add the
\setcommands to the user’s.psqlrcfile.So, your
$HOME/.psqlrcwould be something like this: