Re: syntax

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kogorman(at)pacbell(dot)net
Cc: PGSQL Hackers List <pgsql-hackers(at)hub(dot)org>
Subject: Re: syntax
Date: 2000-10-28 20:41:41
Message-ID: 11404.972765701@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Kevin O'Gorman" <kogorman(at)pacbell(dot)net> writes:
>> Don't you get shift/reduce errors if you remove those precedence specs?
>> I'd expect the <select_clause> grammar to be ambiguous without operator
>> precedence specs ...

> Yah. I would have thought so too. However, when I comment out the
> two %left lines (being careful not to dusturb line numbers) I get the
> absolutely identical gram.c output. So at least for those two things
> the associativity does nothing at all. I'm inclined to leave them commented
> out, so they don't mislead.

Not to put too fine a point on it, but are you talking about the
original grammar or your modified one? Your modified one is erroneous
because it will always associate successive UNION/INTERSECT/EXCEPT
operators left-to-right; this does not meet the SQL spec which insists
that INTERSECT binds more tightly than the other two. Given that, I'm
not surprised that the precedences have no effect.

> I don't see precedence in SQL92; set operations
> seem to be left associative of equal priority.

Better take another look at the <query expression>, <query term>,
<query primary> hierarchy then...

regards, tom lane

In response to

  • Re: syntax at 2000-10-28 18:48:14 from Kevin O'Gorman

Responses

  • Re: syntax at 2000-10-28 20:54:07 from Bruce Momjian

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-10-28 20:52:31 Numeric file names
Previous Message Bruce Momjian 2000-10-28 19:41:24 Re: Gram.y patches for better parenthesis handling.