Re: Patch: psql \whoami option - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Patch: psql \whoami option
Date
Msg-id 11750.1277128853@sss.pgh.pa.us
Whole thread Raw
In response to Re: Patch: psql \whoami option  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Patch: psql \whoami option
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Sun, Jun 20, 2010 at 10:51 PM, Steve Singer <ssinger_pg@sympatico.ca> wrote:
>> One comment I have on the output format is that values (ie the database
>> name) are enclosed in double quotes but the values being quoted can contain
>> double quotes that are not being escaped.

This is the same as standard practice in just about every other
message...

> It seems like for user and database it might be sensible to apply
> PQescapeIdentifier to the value before printing it.

I think this would actually be a remarkably bad idea in this particular
instance, because in the majority of cases psql does not apply
identifier dequoting rules to user and database names.  What is printed
should be the same as what you'd need to give to \connect, for example.

> The port is, I guess, being stored as a string, but doesn't it have to
> be an integer?  In which case, why quote it at all?

Agreed, no need for quotes there.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Proposal for 9.1: WAL streaming from WAL buffers
Next
From: Andrew Dunstan
Date:
Subject: Re: extensible enum types