Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

lapug by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group