Support PlaceHolderVars in MERGE actions.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 15 Mar 2023 15:59:18 +0000 (11:59 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 15 Mar 2023 15:59:18 +0000 (11:59 -0400)
commite3ac85014eb280ee2e82b36dc3be1b62c838b3e4
tree61342f702fda4694a94a96f9a64cf9287a4e308e
parenta0137388cb642bcc1ba10fb906b88658653c589d
Support PlaceHolderVars in MERGE actions.

preprocess_targetlist thought PHVs couldn't appear here.
It was mistaken, as per report from Önder Kalacı.

Surveying other pull_var_clause calls, I noted no similar errors,
but I did notice that qual_is_pushdown_safe's assertion about
!contain_window_function was pointless, because the following
pull_var_clause call would complain about them anyway.  In HEAD
only, remove the redundant Assert and improve the commentary.

Discussion: https://postgr.es/m/CACawEhUuum-gC_2S3sXLTcsk7bUSPSHOD+g1ZpfKaDK-KKPPWA@mail.gmail.com
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/prep/preptlist.c
src/test/regress/expected/merge.out
src/test/regress/sql/merge.sql