Re: Changed SRF in targetlist handling - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Changed SRF in targetlist handling
Date
Msg-id 20160822190101.5r3thmffjl62tn3f@alap3.anarazel.de
Whole thread Raw
In response to Re: Changed SRF in targetlist handling  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 2016-05-23 09:26:03 +0800, Craig Ringer wrote:
> SRFs-in-tlist are a lot faster for lockstep iteration etc. They're also
> much simpler to write, though if the result result rowcount differs
> unexpectedly between the functions you get exciting and unexpected
> behaviour.
> 
> WITH ORDINALITY provides what I think is the last of the functionality
> needed to replace SRFs-in-from, but at a syntatactic complexity and
> performance cost. The following example demonstrates that, though it
> doesn't do anything that needs LATERAL etc. I'm aware the following aren't
> semantically identical if the rowcounts differ.

I think here you're just missing ROWS FROM (generate_series(..), generate_series(...))

Andres



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Exporting more function in libpq
Next
From: Robert Haas
Date:
Subject: Re: Bug in abbreviated keys abort handling (found with amcheck)