parsed.org

Tips by tag: variables

Setting the Prompt in 'psql' by cygnus on Jan 14, 2005 12:34 PM

Set the PROMPT1 variable using psql prompt escape sequences:

\set PROMPT1 '[%n@%M:%/]=%# '
  • %n - User
  • %M - Host ([local] or the domain or IP address of the server)
  • %/ - Database
  • %# - # if superuser, $ if regular user.
commandsconfigurationescapepostgresqlpsqlvariables
RSS