Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group