Re: Reserved words and delimited identifiers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Reserved words and delimited identifiers
Date
Msg-id 9768.1322664918@sss.pgh.pa.us
Whole thread Raw
In response to Re: Reserved words and delimited identifiers  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Reserved words and delimited identifiers
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.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


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Reserved words and delimited identifiers
Next
From: "Albe Laurenz"
Date:
Subject: Re: review: CHECK FUNCTION statement