Re: Multiple SRF right after SELECT - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Multiple SRF right after SELECT
Date
Msg-id 1620.1205939426@sss.pgh.pa.us
Whole thread Raw
In response to Multiple SRF right after SELECT  ("Nikolay Samokhvalov" <samokhvalov@gmail.com>)
List pgsql-hackers
"Nikolay Samokhvalov" <samokhvalov@gmail.com> writes:
>  1. Is it correct at all to use SRF in select list, w/o explicit FROM?

You can read about the current behavior in ExecTargetList, but basically
the idea is to cycle all the SRFs until they all say "done" at the same
time.  So the number of result rows is the least common multiple of the
sizes of the SRF outputs.

This behavior is pretty random, I agree, but we inherited it from
Berkeley ... and even if we didn't care about breaking existing
applications that might rely on it, it's not exactly clear what it
should be instead.

The fact that there isn't any obviously right behavior is why I'd
prefer to deprecate SRFs in targetlists ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: stored procedure stats in collector
Next
From: Tom Lane
Date:
Subject: Re: Final Thoughts for 8.3 on LWLocking and Scalability