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

Re: psql prompt

From: Aleksey Tsalolikhin <atsaloli(dot)tech(at)gmail(dot)com>
To: Los Angeles PostgreSQL Users Group <lapug(at)postgresql(dot)org>
Subject: Re: psql prompt
Date: 2010-03-26 20:44:38
Message-ID: (view raw or whole thread)
Lists: lapug
Correction: this gives you the client hostname, not the server hostname.
I don't see any way to get the server hostname from the server itself.

Maybe some kind of SQL query can tell me that?


On Fri, Mar 26, 2010 at 1:40 PM, Aleksey Tsalolikhin
<atsaloli(dot)tech(at)gmail(dot)com> wrote:
> 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:
> Best,
> -at

In response to

  • psql prompt at 2010-03-26 20:40:01 from Aleksey Tsalolikhin


lapug by date

Next:From: brian dolanDate: 2010-03-26 20:47:26
Subject: Re: psql prompt
Previous:From: Aleksey TsalolikhinDate: 2010-03-26 20:40:01
Subject: psql prompt

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