psql prompt

From: Aleksey Tsalolikhin <atsaloli(dot)tech(at)gmail(dot)com>
To: Los Angeles PostgreSQL Users Group <lapug(at)postgresql(dot)org>
Subject: psql prompt
Date: 2010-03-26 20:40:01
Message-ID: d17c5b141003261340k7d14c5ddpdd552ed98b0685fa@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: lapug

Hi, list. Just found out you can customize the psql prompt.

For example:

\set PROMPT1 '%n(at)%/ on %`hostname` (%M:%>) %# '

Tells you db user, db name, server hostname,
and the IP address and port that the db server
listens on, plus the prompt (regular or superuser).

If you like it, put it in your ~/.psqlrc

You can go fancy with colors, etc.

Reference: http://www.postgresql.org/docs/8.4/interactive/app-psql.html

Best,
-at

Responses

Browse lapug by date

  From Date Subject
Next Message Aleksey Tsalolikhin 2010-03-26 20:44:38 Re: psql prompt
Previous Message Aleksey Tsalolikhin 2010-02-24 23:41:48 Re: Scale 8X Exhibition Booth Attendants