Re: Patch: psql \whoami option

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

2010/1/27 David Christensen <david(at)endpoint(dot)com>:
>
> On Jan 27, 2010, at 4:01 AM, 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.
>
> Yeah, I debated that; right now, it just ignores any output it doesn't know about and spits out the human-readable format.

yeah, that's not very forwards-compatible. Someone uses it in the
wrong way, and suddenly their stuff gets broken if we choose to modify
it in the future. If we say we're only going ot accept two options,
let's enforce that and show an error/help message if the user typos.

Guessing is not what we do :-) We leave that to other databases...

--
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 David Christensen 2010-01-27 14:14:17 Re: Patch: psql \whoami option
Previous Message David Christensen 2010-01-27 14:06:17 Re: Patch: psql \whoami option