mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Modified files for MERGE
This commit is contained in:
@ -233,6 +233,7 @@ standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
|
||||
case CMD_INSERT:
|
||||
case CMD_DELETE:
|
||||
case CMD_UPDATE:
|
||||
case CMD_MERGE:
|
||||
estate->es_output_cid = GetCurrentCommandId(true);
|
||||
break;
|
||||
|
||||
@ -1357,6 +1358,9 @@ InitResultRelInfo(ResultRelInfo *resultRelInfo,
|
||||
resultRelInfo->ri_onConflictArbiterIndexes = NIL;
|
||||
resultRelInfo->ri_onConflict = NULL;
|
||||
|
||||
resultRelInfo->ri_mergeTargetRTI = 0;
|
||||
resultRelInfo->ri_mergeState = (MergeState *) palloc0(sizeof (MergeState));
|
||||
|
||||
/*
|
||||
* Partition constraint, which also includes the partition constraint of
|
||||
* all the ancestors that are partitions. Note that it will be checked
|
||||
@ -2205,6 +2209,19 @@ ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo,
|
||||
errmsg("new row violates row-level security policy for table \"%s\"",
|
||||
wco->relname)));
|
||||
break;
|
||||
case WCO_RLS_MERGE_UPDATE_CHECK:
|
||||
case WCO_RLS_MERGE_DELETE_CHECK:
|
||||
if (wco->polname != NULL)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
|
||||
errmsg("target row violates row-level security policy \"%s\" (USING expression) for table \"%s\"",
|
||||
wco->polname, wco->relname)));
|
||||
else
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
|
||||
errmsg("target row violates row-level security policy (USING expression) for table \"%s\"",
|
||||
wco->relname)));
|
||||
break;
|
||||
case WCO_RLS_CONFLICT_CHECK:
|
||||
if (wco->polname != NULL)
|
||||
ereport(ERROR,
|
||||
|
Reference in New Issue
Block a user