Re: Quoting of psql \d output

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, chriskl(at)familyhealth(dot)com(dot)au, pgsql-patches(at)postgresql(dot)org
Subject: Re: Quoting of psql \d output
Date: 2003-12-27 16:39:56
Message-ID: 200312271639.hBRGdu304535@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> "Peter Eisentraut" <peter_e(at)gmx(dot)net> writes:
> > Christopher Kings-Lynne writes:
> >> Now you've lost me - how is a user-inputted object name translatable?
>
> > Not all languages use "..." as quote symbols, but if you make them part of
> > some string that comes from the backend, it becomes prohibitively hard to
> > translate it correctly.
>
> Hm. This gets back to the point we've discussed before: there is some
> confusion between SQL's use of quoted identifiers and the customary
> English use of quote marks to set off text that should be distinguished
> from the surrounding sentence.

True. In the "Table classname.tablename" case, there is no requirement
for quotes in English, but there is for technical reasons. Imagine:

Table My class.My table

Looks kind of strange without quotes:

Table "My class"."My table"

Still looks strange, but better. :-)

> Essentially, Bruce's proposed patch moves the use of quotes in \d table
> headers to conform to SQL's "technical" use of quotes, while you are
> arguing for sticking with the message style guidelines' "human-oriented"
> use of quotes.
>
> I can see merit in both positions. But I also see merit in the
> compromise position of not using quotes at all. I don't see a strong
> need to demarcate table name from surrounding text in a context as
> simple as this --- is
> Table "foo"
> really any easier to read than
> Table foo
> ? And Peter is correct that the former introduces translation issues
> when you think about languages that don't customarily use "..." as
> quotation marks.

As I saw, Peter was suggesting to always use quotes to match the message
guidelines:

Table "myclass"."mytable"

or

Table "mytable" (Class "myclass")

However, I have not seen anyone prefer that except Peter so that will
not be adopted unless Peter can find more people that agree with him.

So it seems we can either go with no quotes, or smart quotes (which my
patch implemented). I feel my patch does the best of both worlds, by
quoting as needed, and as the psql \d commands actually require anyway,
and as used by pg_dump and in SQL queries.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ohp 2003-12-27 16:56:03 Re: [PATCHES] update i386 spinlock for hyperthreading
Previous Message Bruce Momjian 2003-12-27 16:31:02 Re: Docu question

Browse pgsql-patches by date

  From Date Subject
Next Message ohp 2003-12-27 16:56:03 Re: [PATCHES] update i386 spinlock for hyperthreading
Previous Message ohp 2003-12-27 10:46:01 Re: update i386 spinlock for hyperthreading