summaryrefslogtreecommitdiff
path: root/src/backend/executor/execPartition.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/execPartition.c')
-rw-r--r--src/backend/executor/execPartition.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index 514eae1037d..1f2da072632 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -360,8 +360,12 @@ ExecFindPartition(ModifyTableState *mtstate,
true, false);
if (rri)
{
+ ModifyTable *node = (ModifyTable *) mtstate->ps.plan;
+
/* Verify this ResultRelInfo allows INSERTs */
- CheckValidResultRel(rri, CMD_INSERT, NIL);
+ CheckValidResultRel(rri, CMD_INSERT,
+ node ? node->onConflictAction : ONCONFLICT_NONE,
+ NIL);
/*
* Initialize information needed to insert this and
@@ -527,7 +531,8 @@ ExecInitPartitionInfo(ModifyTableState *mtstate, EState *estate,
* partition-key becomes a DELETE+INSERT operation, so this check is still
* required when the operation is CMD_UPDATE.
*/
- CheckValidResultRel(leaf_part_rri, CMD_INSERT, NIL);
+ CheckValidResultRel(leaf_part_rri, CMD_INSERT,
+ node ? node->onConflictAction : ONCONFLICT_NONE, NIL);
/*
* Open partition indices. The user may have asked to check for conflicts