[BUGS] create table bug with reserved words?

2001-02-15 Thread Chris Storah

There seems to be an inconsistency in the parsing of create table (possibly
other SQL syntax?):

create table test (call int, end, int, select int);
Fails with ERROR: parser: parse error at or near "create"

create table test (call int, end1, int, select1 int);
Works.

Call, End and Select are reserved words, but why does 'Call' work and the
others fail?
Is this a bug - should the parser cope with any reserved words as
identifiers?

Thanks,
Chris







Re: [BUGS] create table bug with reserved words?

2001-02-15 Thread Tom Lane

Chris Storah <[EMAIL PROTECTED]> writes:
> Is this a bug - should the parser cope with any reserved words as
> identifiers?

No, and no.  If you could use them as identifiers then they wouldn't
be reserved words, would they?

Some keywords are "more reserved" than others in the Postgres parser;
see the distinction between ColId and ColLabel in gram.y if you want
the details.  AFAICT, "CALL" is not a keyword at all in Postgres.

regards, tom lane



Re: [BUGS] create table bug with reserved words?

2001-02-15 Thread Peter Eisentraut

Chris Storah writes:

> There seems to be an inconsistency in the parsing of create table (possibly
> other SQL syntax?):
>
>   create table test (call int, end, int, select int);
> Fails with ERROR: parser: parse error at or near "create"

SELECT is a reserved word.  The error message just shows that the parser
is significantly confused.

>   create table test (call int, end1, int, select1 int);
> Works.
>
> Call, End and Select are reserved words, but why does 'Call' work and the
> others fail?
> Is this a bug - should the parser cope with any reserved words as
> identifiers?
>
> Thanks,
> Chris
>
>
>
>
>

-- 
Peter Eisentraut  [EMAIL PROTECTED]   http://yi.org/peter-e/