1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

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
This commit is contained in:
Dean Rasheed
2025-03-29 09:58:40 +00:00
parent a0ed19e0a9
commit 8b6a0e2392
4 changed files with 34 additions and 2 deletions

View File

@ -3784,7 +3784,7 @@ ExecInitMerge(ModifyTableState *mtstate, EState *estate)
case CMD_NOTHING:
break;
default:
elog(ERROR, "unknown operation");
elog(ERROR, "unknown action in MERGE WHEN clause");
break;
}
}