Re: Reserved words and delimited identifiers

From: Joe Abbate <jma(at)freedomcircle(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reserved words and delimited identifiers
Date: 2011-11-30 05:15:09
Message-ID: 4ED5BBDD.4080005@freedomcircle.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-11-30 05:48:05 Re: Reserved words and delimited identifiers
Previous Message Robert Haas 2011-11-30 05:03:43 Re: Reserved words and delimited identifiers