Re: "AS" by the syntax of table reference.(8.4 proposal)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: "AS" by the syntax of table reference.(8.4 proposal)
Date: 2008-02-09 21:24:08
Message-ID: 224.1202592248@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> Of course it would still be better if we could get it closer to ColId. YEAR
> MONTH DAY HOUR MINUTE SECOND the only problem spots? How much else had to
> change to work around other conflicts?

No, to make it ColId we'd also have to reserve all of these:
CHAR_P
CHARACTER
DOUBLE_P
VARYING
WITH
WITHOUT
and even that doesn't seem to get us quite out of the woods, as there's
still a reduce/reduce conflict here:

state 2523

1118 character: CHARACTER . opt_varying
1744 reserved_keyword: CHARACTER .

VARYING shift, and go to state 1350

')' reduce using rule 1125 (opt_varying)
')' [reduce using rule 1744 (reserved_keyword)]
',' reduce using rule 1125 (opt_varying)
',' [reduce using rule 1744 (reserved_keyword)]
$default reduce using rule 1125 (opt_varying)

opt_varying go to state 1356

which I'm not sure how to get rid of.

A possibly bigger problem is that the solution for postfix ops doesn't
scale nicely: we'd have to list not only IDENT, but *every* can-be-ColId
keyword, in the %precedence list, which (a) is a maintenance headache,
(b) causes a conflict because some are already listed there with the
wrong precedence for this purpose, and (c) is very scary from the
viewpoint of possibly silently suppressing warnings of future grammar
ambiguities. I'm not even that happy with giving IDENT a precedence;
giving precedences to 270 or so currently precedence-less tokens
just doesn't sound safe.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2008-02-09 21:58:00 Re: PostgreSQL 8.4 development plan
Previous Message Gregory Stark 2008-02-09 20:50:09 Re: "AS" by the syntax of table reference.(8.4 proposal)