Re: Quoting of psql \d output - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: Quoting of psql \d output
Date
Msg-id 3075.62.158.112.252.1072369524.squirrel@new.host.name
Whole thread Raw
In response to Re: Quoting of psql \d output  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian writes:
> I see pg_dump using the same rules that I am proposing:

Which makes my point.

> To me quoting the table name is like quoting the name of a section
> heading (which people don't do),

The message style guidelines specify that you should always quote a %s if
it might contain characters that would cause confusion about where the
plugged-in value starts and ends, and that you quote every %s the same
way, because when the user reads the value, the user just wants to
recognize the value and does not care about whether the value might in
some context be an SQL identifier or who knows what. When you write
section titles, you know the titles ahead of time, so you don't need to
guard against confusion.

> You were suggesting no quotes at all.  Would this display be OK?
>
>     test=> \d "xx y"
>          Table public.xx y

No, that doesn't work.  Either we write it in proper SQL terms, that is

public."xx y"

or we write it in human terms, that is

Table "xx y" (Schema "public")

(or some variation).  What I'm trying to say is, since we're addressing
humans, we should use the human terms.




pgsql-patches by date:

Previous
From: "Peter Eisentraut"
Date:
Subject: Re: Quoting of psql \d output
Next
From: Claudio Natoli
Date:
Subject: fork/exec patch: pre-CreateProcess finalization