aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execPartition.c
diff options
context:
space:
mode:
authorDean Rasheed <dean.a.rasheed@gmail.com>2024-02-29 15:56:59 +0000
committerDean Rasheed <dean.a.rasheed@gmail.com>2024-02-29 15:56:59 +0000
commit5f2e179bd31e5f5803005101eb12a8d7bf8db8f3 (patch)
tree838a9f273c1d3d825db322161c0b8cdf3fbb0ce1 /src/backend/executor/execPartition.c
parent8b29a119fdaa381d6f75105f539b1e658c0f8cdb (diff)
downloadpostgresql-5f2e179bd31e5f5803005101eb12a8d7bf8db8f3.tar.gz
postgresql-5f2e179bd31e5f5803005101eb12a8d7bf8db8f3.zip
Support MERGE into updatable views.
This allows the target relation of MERGE to be an auto-updatable or trigger-updatable view, and includes support for WITH CHECK OPTION, security barrier views, and security invoker views. A trigger-updatable view must have INSTEAD OF triggers for every type of action (INSERT, UPDATE, and DELETE) mentioned in the MERGE command. An auto-updatable view must not have any INSTEAD OF triggers. Mixing auto-update and trigger-update actions (i.e., having a partial set of INSTEAD OF triggers) is not supported. Rule-updatable views are also not supported, since there is no rewriter support for non-SELECT rules with MERGE operations. Dean Rasheed, reviewed by Jian He and Alvaro Herrera. Discussion: https://postgr.es/m/CAEZATCVcB1g0nmxuEc-A+gGB0HnfcGQNGYH7gS=7rq0u0zOBXA@mail.gmail.com
Diffstat (limited to 'src/backend/executor/execPartition.c')
-rw-r--r--src/backend/executor/execPartition.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index b22040ae8ee..429f0a8dd98 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -361,7 +361,7 @@ ExecFindPartition(ModifyTableState *mtstate,
if (rri)
{
/* Verify this ResultRelInfo allows INSERTs */
- CheckValidResultRel(rri, CMD_INSERT);
+ CheckValidResultRel(rri, CMD_INSERT, NIL);
/*
* Initialize information needed to insert this and
@@ -527,7 +527,7 @@ 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);
+ CheckValidResultRel(leaf_part_rri, CMD_INSERT, NIL);
/*
* Open partition indices. The user may have asked to check for conflicts