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

Re: Reserved words and delimited identifiers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Joe Abbate <jma(at)freedomcircle(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reserved words and delimited identifiers
Date: 2011-11-30 14:55:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 11/30/2011 09:02 AM, Alvaro Herrera wrote:
>> I wonder if it would simpler to just not quote type names except when
>> absolutely necessary.

> Yeah, and very much less ugly. Ploughing through masses of unnecessary 
> quotes is they way to a headache. quote_ident() gets this right.

But, per this discussion, you can't just blindly apply quote_ident to a
type name, because it may not *be* an identifier.

One possible solution, if you're getting type information about columns
from the server, is to cast the type OID to regtype and let the regtype
output converter make all the decisions.  It's less notation than a join
to pg_type anyway.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Albe LaurenzDate: 2011-11-30 15:23:16
Subject: Re: review: CHECK FUNCTION statement
Previous:From: Andrew DunstanDate: 2011-11-30 14:35:41
Subject: Re: Reserved words and delimited identifiers

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