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

Re: Quoting of psql \d output

From: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
To: <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <peter_e(at)gmx(dot)net>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Quoting of psql \d output
Date: 2003-12-25 16:25:24
Message-ID: 3075.62.158.112.252.1072369524.squirrel@new.host.name (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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.




In response to

pgsql-hackers by date

Next:From: Jan WieckDate: 2003-12-25 16:36:09
Subject: Re: PostgreSQL port to pure Java?
Previous:From: Peter EisentrautDate: 2003-12-25 16:14:47
Subject: Re: Quoting of psql \d output

pgsql-patches by date

Next:From: Claudio NatoliDate: 2003-12-26 07:11:49
Subject: fork/exec patch: pre-CreateProcess finalization
Previous:From: Peter EisentrautDate: 2003-12-25 16:14:47
Subject: Re: Quoting of psql \d output

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