Re: [HACKERS] Keywords - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] Keywords
Date
Msg-id 36C1A1AA.92692BE1@alumni.caltech.edu
Whole thread Raw
In response to Keywords  (Michael Meskes <Michael_Meskes@topmail.de>)
Responses Re: [HACKERS] Keywords  (Michael Meskes <Michael_Meskes@topmail.de>)
List pgsql-hackers
> > However, it is handled in a special way: in contexts where one would
> > expect a type name, "int" is translated to "int4" explicitly (very 
> > early on, from gram.y). Otherwise it is not translated.
> And int4 is reserved? Is is not in keywords.c though.

No! That's the point, really; there are very few keywords which are type
names. afaik the only cases where type names show up as keywords are
where SQL92 syntax requires special handling, such as "TIMESTAMP WITH
TIME ZONE" and "NATIONAL CHARACTER VARYING". And even in those cases
I've tried to allow as broad a usage as possible, so even though
something is a keyword it may be allowed as a column name, type name, or
identifier unless prohibited by the yacc one-token-lookahead
limitations.

Look in the hardcopy or html User's Guide for the chapter on "Syntax",
which lists the SQL92 and Postgres reserved words. I neglected to add
that chapter to the "integrated docs" (postgres.html) in the last
release, so you will need to look at user.html to find it. Also, it
doesn't include recent changes from Vadim et al for MVCC, which I expect
will add a few keywords eventually.
                     - Tom


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] PostgreSQL and Solaris 7?
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: [GENERAL] A mistake generates strange result