mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
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
This commit is contained in:
@@ -155,17 +155,15 @@ preprocess_targetlist(PlannerInfo *root)
|
||||
extract_update_targetlist_colnos(action->targetList);
|
||||
|
||||
/*
|
||||
* Add resjunk entries for any Vars used in each action's
|
||||
* targetlist and WHEN condition that belong to relations other
|
||||
* than target. Note that aggregates, window functions and
|
||||
* placeholder vars are not possible anywhere in MERGE's WHEN
|
||||
* clauses. (PHVs may be added later, but they don't concern us
|
||||
* here.)
|
||||
* Add resjunk entries for any Vars and PlaceHolderVars used in
|
||||
* each action's targetlist and WHEN condition that belong to
|
||||
* relations other than the target. We don't expect to see any
|
||||
* aggregates or window functions here.
|
||||
*/
|
||||
vars = pull_var_clause((Node *)
|
||||
list_concat_copy((List *) action->qual,
|
||||
action->targetList),
|
||||
0);
|
||||
PVC_INCLUDE_PLACEHOLDERS);
|
||||
foreach(l2, vars)
|
||||
{
|
||||
Var *var = (Var *) lfirst(l2);
|
||||
|
Reference in New Issue
Block a user