Re: check_srf_call_placement() isn't always setting p_hasTargetSRFs

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Date: 2017-01-16T19:10:24Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> Is there a reason not to just set p_hasTargetSRFs once towards the end
> of the function, instead of doing so for all the non-error cases?

Yes: it's not supposed to get set when the SRF is in FROM.

> I wonder if there should be a seperate expression type for
> the INSERT ... VALUES(exactly-one-row); since that behaves quite
> differently.

Perhaps.  Or maybe we should just use EXPR_KIND_SELECT_TARGET for that?

			regards, tom lane


Commits

  1. Fix check_srf_call_placement() to handle VALUES cases correctly.