Re: Review: UNNEST (and other functions) WITH ORDINALITY - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Review: UNNEST (and other functions) WITH ORDINALITY
Date
Msg-id CAM-w4HMKVT9oYHCfe2xDraBcL_beX-xrU99WAfOK_CrkDFRNvg@mail.gmail.com
Whole thread Raw
In response to Re: Review: UNNEST (and other functions) WITH ORDINALITY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Jul 28, 2013 at 7:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I suspect it's likely to come out about the same either way once you
> account for all the uses of WITH.  Might be worth trying both to see
> which seems less ugly.

So I'm not really sure how to do it the other way. Once you're in
parser rules I don't know how easy it is to start injecting tokens.
But it seems cleaner this way where only the places where accepting
WITH_ORDINALITY and WITH_TIME create conflicts need to worry about it.
Everywhere else can just accept "with" and not worry about the
problem.

I did the same thing to NULLS_FIRST and NULLS_LAST but then I realized
I couldn't actually fix the rules the same way. NULLS_P is in
unreserved_keywords and adding NULLS_FIRST or NULLS_LAST there creates
conflicts of course. This week isn't one of the two weeks of my life
when I grokked LALR grammars and how to resolve conflicts in bison.

Incidentally I noticed a problem that is actually a bug in the WITH
ORDINALITY patch. The ecpg preprocessor perl script is broken now.
Will fix.


--
greg

Attachment

pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Bison 3.0 updates
Next
From: Josh Berkus
Date:
Subject: Re: Review: UNNEST (and other functions) WITH ORDINALITY