Re: Patch: psql \whoami option

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Martin Atukunda <matlads(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, David Christensen <david(at)endpoint(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: psql \whoami option
Date: 2010-01-27 11:36:15
Message-ID: 9837222c1001270336q317b7f2yeb765091fe961a77@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think the idea is that if you do that, it'll be there all the time,
potentially "crowding the space".

//Magnus

2010/1/27 Martin Atukunda <matlads(at)gmail(dot)com>:
> How about using the psql prompt to convey this information? IIRC the psql prompt can be configured to show the hostname, server, port and other fields. Wouldn't this be enough? or am I missing something?
>
> - Martin -
>
> On 27 Jan 2010, at 13:01, Magnus Hagander wrote:
>
>> 2010/1/27 Josh Berkus <josh(at)agliodbs(dot)com>:
>>>
>>> On 1/26/10 3:24 PM, David Christensen wrote:
>>>>
>>>> -hackers,
>>>>
>>>> In the spirit of small, but hopefully useful interface improvement
>>>> patches, enclosed for your review is a patch for providing psql with a
>>>> \whoami command (maybe a better name is \conninfo or similar).  Its
>>>> purpose is to print information about the current connection, by default
>>>> in a human-readable format.  There is also an optional format parameter
>>>> which currently accepts 'dsn' as an option to output the current
>>>> connection information as a DSN.
>>
>> On a first note, it seems like the check for the parameter "dsn" isn't
>> "complete". Without testing it, it looks like it would be possible to
>> run "\whoami foobar", which should give an error.
>>
>>
>>> oooh, I could really use this.  +1 to put it in 9.1-first CF.
>>>
>>> however, \conninfo is probably the better name.  And what about a
>>
>> +1 on that name.
>>
>>> postgresql function version for non-psql connections?
>>
>> How could that function possibly know what the connection looks like
>> from the client side? Think NAT, think proxies, think connection
>> poolers.
>>
>> --
>> Magnus Hagander
>> Me: http://www.hagander.net/
>> Work: http://www.redpill-linpro.com/
>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>
>

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-01-27 11:37:43 Re: testing cvs HEAD - HS/SR - missing file
Previous Message Martin Atukunda 2010-01-27 11:23:44 Re: Patch: psql \whoami option