Re: [HACKERS] Keywords

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Hannu Krosing <hannu(at)trust(dot)ee>
Cc: Michael Meskes <Michael_Meskes(at)topmail(dot)de>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Keywords
Date: 1999-02-10 02:28:10
Message-ID: 36C0EEBA.9FDD6961@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing wrote:
>
> Michael Meskes wrote:
> >
> > On Mon, Feb 08, 1999 at 01:15:09PM -0500, Bruce Momjian wrote:
> > > We don't reserve the type names as keywords, and because they can
> > > create their own types, it wouldn't make sense.
> > I don't exactly understand that. For instance the 'int' keyword will
> > still be reserved, isn't it?
> hannu=> create table int(int int);
> CREATE
> hannu=> create table int4(int4 int4);
> ERROR: TypeCreate: type int4 already defined
> So it's probably not reserved ;)

INT is an SQL92 reserved word. But it is not a reserved word in
Postgres, since the usage as a reserved word would be exclusively as a
type name. In Postgres, the parser does not require a type name to be
explicitly defined as a keyword (which would make it a de facto reserved
word) since we allow type extensibility. Parsing it explicitly as a
keyword does not buy us any new functionality (since we allow type names
which are definitely *not* keywords anyway), so we don't do it.

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.

- Tom

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1999-02-10 02:28:11 Re: [HACKERS] TIME QUALIFICATION
Previous Message Tatsuo Ishii 1999-02-10 02:02:44 NEXTSTEP porting problems