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

From Craig Ringer
Subject Re: Review: UNNEST (and other functions) WITH ORDINALITY
Date
Msg-id 51F67D97.2090109@2ndquadrant.com
Whole thread Raw
In response to Re: Review: UNNEST (and other functions) WITH ORDINALITY  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On 07/29/2013 08:02 PM, Greg Stark wrote:
>> > Unless LATERAL provides a way to do lock-step iteration through a pair
>> > (or more) of functions I don't think we can get rid of SRFs [in select target lists] yet
> You don't even need lateral. This works fine:
> 
> postgres=# select * from generate_series(1,10) with ordinality as

Exactly - that's why the previous paragraph was:

>> As far as I can tell LATERAL won't help with this; you'd need unnest
>> WITH ORDINALITY then a join on the ordinal, or you'd need full support
>> for SQL UNNEST with multiple array arguments.

;-)

I'm interested to see that it might be possible to evaluate multiple
"WITH ORDINALITY" SRFs in FROM together rather than having to perform a
join. That'd make it a much saner replacement for SRFs in the SELECT list.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Marti Raudsepp
Date:
Subject: Re: Bison 3.0 updates
Next
From: Andrew Dunstan
Date:
Subject: Re: Bison 3.0 updates