Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)
Date: 2016-09-13 18:17:19
Message-ID: 22074.1473790639@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2016-09-13 12:07:35 -0400, Tom Lane wrote:
>> /*
>> - * Don't pull up a subquery that has any set-returning functions in its
>> - * targetlist. Otherwise we might well wind up inserting set-returning
>> - * functions into places where they mustn't go, such as quals of higher
>> - * queries. This also ensures deletion of an empty jointree is valid.
>> - */
>> - if (expression_returns_set((Node *) subquery->targetList))
>> - return false;

> I don't quite understand parts of the comment you removed here. What
> does "This also ensures deletion of an empty jointree is valid." mean?

TBH, I don't remember what that was about anymore. Whatever it was might
not apply now, anyway. If there was something to it, maybe we'll
rediscover it while we're fooling with tSRFs, and then we can insert a
less cryptic comment.

> Looks good, except that you didn't adopt the hunk adjusting
> src/backend/executor/README, which still seems to read:

Ah, I missed that there was anything to change docs-wise. Will fix.

Thanks for looking it over!

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Victor Wagner 2016-09-13 18:21:53 Inheriting PostgresNode object
Previous Message Andrew Borodin 2016-09-13 18:10:43 Re: GiST penalty functions [PoC]