Fix an oversight in cbc127917 to handle MERGE correctly ExecInitModifyTable() forgot to trim MERGE-related lists to exclude entries for result relations pruned during initial pruning, so fix that.
While at it, make the function's use of the pruned resultRelations list, rather than ModifyTable.resultRelations, more consistent. Reported-by: Alexander Lakhin <[email protected]> (via sqlsmith) Reviewed-by: Junwang Zhao <[email protected]> Discussion: https://postgr.es/m/[email protected] Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/75dfde13639a57513e23e58c961a69c5bbf017b6 Modified Files -------------- src/backend/executor/nodeModifyTable.c | 35 +++++++++--- src/include/nodes/execnodes.h | 7 ++- src/test/regress/expected/partition_prune.out | 77 +++++++++++++++++++++++++++ src/test/regress/sql/partition_prune.sql | 25 +++++++++ 4 files changed, 134 insertions(+), 10 deletions(-)
