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

From Joe Abbate
Subject Re: Reserved words and delimited identifiers
Date
Msg-id 4ED5BBDD.4080005@freedomcircle.com
Whole thread Raw
In response to Re: Reserved words and delimited identifiers  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Reserved words and delimited identifiers
List pgsql-hackers
On 11/29/2011 11:41 PM, Tom Lane wrote:
> Another way to say that is that the type int4 can be specified in two
> ways:
> 
>     int4        (an identifier)
>     INTEGER        (a keyword)
> 
> Quoting "int4" is no problem, because it's still an identifier, but
> quoting "integer" takes away its keyword nature, so it doesn't get
> recognized.
> 
> The fact that INTEGER is a keyword, and not an identifier, is per SQL
> specification.  We could perhaps hack things so that "integer" as an
> identifier would also work, but I doubt that we'd go so far as to make
> "INTEGER" (a different identifier) also work, and we'd certainly not
> be able to do much about the spec's more exciting deviations from
> identifier-looking type names, such as CHARACTER VARYING or DOUBLE
> PRECISION.
> 
> Or to put it more pithily: the SQL committee's ideas of good syntax
> seem to have been frozen around the time COBOL was invented.

Thanks Tom and Robert.  I think I understand the problem now.  I guess
I'll have to work around this "quirk" by dealing specially with type
names and not quote them when they're in the shorter list of SQL
Standard reserved words.

Joe


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Reserved words and delimited identifiers
Next
From: Tom Lane
Date:
Subject: Re: Reserved words and delimited identifiers