Re: Patch: psql \whoami option

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Steve Singer <ssinger_pg(at)sympatico(dot)ca>, David Christensen <david(at)endpoint(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: psql \whoami option
Date: 2010-06-21 14:00:53
Message-ID: 11750.1277128853@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Sun, Jun 20, 2010 at 10:51 PM, Steve Singer <ssinger_pg(at)sympatico(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-06-21 14:43:45 Re: extensible enum types
Previous Message Simon Riggs 2010-06-21 13:50:38 Re: Proposal for 9.1: WAL streaming from WAL buffers