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-w4HN0vVvhjt+m-HqDPTXewPBJp-sLy0E9cOjCwCmeTjMwYA@mail.gmail.com
Whole thread Raw
In response to Re: Review: UNNEST (and other functions) WITH ORDINALITY  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Review: UNNEST (and other functions) WITH ORDINALITY  (David Fetter <david@fetter.org>)
Re: Review: UNNEST (and other functions) WITH ORDINALITY  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
<br /><div class="gmail_quote">On Mon, Aug 5, 2013 at 1:31 AM, Robert Haas <span dir="ltr"><<a
href="mailto:robertmhaas@gmail.com"target="_blank">robertmhaas@gmail.com</a>></span> wrote:<br /><blockquote
class="gmail_quote"style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb adM"><div
class="h5"><br/></div></div>This looks like really nice work.</blockquote></div><br />It does. It's functionally
equivalentto my attempt but with much better comments and cleaner code. <br /><br />But it doesn't seem to cover the
caseI was stumped on, namely "nulls first" appearing in a place where two unreserved keywords can appear consecutively.
Thisdoesn't happen for WITH_* before "with" is a reserved keyword.<br /><br />Looking into it a bit I see that the case
Iwas most worried about is actually a non-issue. We don't support column aliases without "AS" unless the alias is
completelyunknown to the parser. That seems a bit of a strange rule that must make the syntax with the missing AS
prettyunreliable if people are looking for code that will continue to work in future versions. I never knew about
this.<br/><br />The only other case I could come up with in my regression tests is pretty esoteric:<br /><br />CREATE
COLLATIONnulls (locale='C');<br />ALTER OPERATOR CLASS text_ops USING btree RENAME TO first;<br />CREATE TABLE
nulls_first(ttext);<br /> CREATE INDEX nulls_first_i ON nulls_first(t COLLATE nulls first);<br /><br />I'm not 100%
surethere aren't other cases where this can occur though.<br clear="all" /><br />-- <br />greg<br /> 

pgsql-hackers by date:

Previous
From: "Karl O. Pinc"
Date:
Subject: Doc Patch: Subquery section to say that subqueries can't modify data
Next
From: David Johnston
Date:
Subject: Re: Doc Patch: Subquery section to say that subqueries can't modify data