From: | brian dolan <buddha_314(at)yahoo(dot)com> |
---|---|
To: | Aleksey Tsalolikhin <atsaloli(dot)tech(at)gmail(dot)com> |
Cc: | Los Angeles PostgreSQL Users Group <lapug(at)postgresql(dot)org> |
Subject: | Re: psql prompt |
Date: | 2010-03-26 20:47:26 |
Message-ID: | 604DA63F-DF4F-4987-9BB9-73D4B82B21C7@yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | lapug |
Cool! Now I can really screw with my users! Thanks for the tip.
On Mar 26, 2010, at 1:44 PM, Aleksey Tsalolikhin wrote:
> 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?
>
> Aleksey
>
>
> 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: http://www.postgresql.org/docs/8.4/interactive/app-psql.html
>>
>> Best,
>> -at
>>
>
> --
> Sent via lapug mailing list (lapug(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/lapug
~~~~~
may all your sequences converge...
From | Date | Subject | |
---|---|---|---|
Next Message | Aleksey Tsalolikhin | 2010-03-26 21:15:30 | How to print server IP address (Was Re: psql prompt) |
Previous Message | Aleksey Tsalolikhin | 2010-03-26 20:44:38 | Re: psql prompt |