Fix MERGE with DO NOTHING actions into a partitioned table.

Dean Rasheed <dean.a.rasheed@gmail.com>

Commit: 25303678a1d334200c0f1446eef2ebe1aaf2709b
Author: Dean Rasheed <dean.a.rasheed@gmail.com>
Date: 2025-03-29T09:50:14Z
Releases: 17.5
Fix MERGE with DO NOTHING actions into a partitioned table.

ExecInitPartitionInfo() duplicates much of the logic in
ExecInitMerge(), except that it failed to handle DO NOTHING
actions. This would cause an "unknown action in MERGE WHEN clause"
error if a MERGE with any DO NOTHING actions attempted to insert into
a partition not already initialised by ExecInitModifyTable().

Bug: #18871
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Gurjeet Singh <gurjeet@singh.im>
Discussion: https://postgr.es/m/18871-b44e3c96de3bd2e8%40postgresql.org
Backpatch-through: 15

Files

Discussion