200 foreach(lc, targetList)
207 if (attno >= resultDesc->
natts)
209 (
errcode(ERRCODE_DATATYPE_MISMATCH),
210 errmsg(
"table row type and query-specified row type do not match"),
211 errdetail(
"Query has too many columns.")));
215 if (!attr->attisdropped)
220 (
errcode(ERRCODE_DATATYPE_MISMATCH),
221 errmsg(
"table row type and query-specified row type do not match"),
222 errdetail(
"Table has type %s at ordinal position %d, but query expects %s.",
237 (
errcode(ERRCODE_DATATYPE_MISMATCH),
238 errmsg(
"table row type and query-specified row type do not match"),
239 errdetail(
"Query provides a value for a dropped column at ordinal position %d.",
243 if (attno != resultDesc->
natts)
245 (
errcode(ERRCODE_DATATYPE_MISMATCH),
246 errmsg(
"table row type and query-specified row type do not match"),
247 errdetail(
"Query has too few columns.")));
295 elog(
ERROR,
"unrecognized commandType: %d", (
int) cmdType);
368 errmsg(
"could not serialize access due to concurrent update")));
388 elog(
ERROR,
"failed to fetch conflicting tuple for ON CONFLICT");
412 int natts = tupdesc->
natts;
414 int ri_NumGeneratedNeeded;
441 ri_NumGeneratedNeeded = 0;
443 for (
int i = 0;
i < natts;
i++)
445 if (
TupleDescAttr(tupdesc,
i)->attgenerated == ATTRIBUTE_GENERATED_STORED)
452 elog(
ERROR,
"no generation expression found for column number %d of table \"%s\"",
471 ri_NumGeneratedNeeded++;
512 int natts = tupdesc->
natts;
546 nulls =
palloc(
sizeof(*nulls) * natts);
549 memcpy(nulls, slot->
tts_isnull,
sizeof(*nulls) * natts);
551 for (
int i = 0;
i < natts;
i++)
555 if (ri_GeneratedExprs[
i])
585 memcpy(slot->
tts_isnull, nulls,
sizeof(*nulls) * natts);
609 bool need_projection =
false;
613 foreach(l, subplan->targetlist)
618 insertTargetList =
lappend(insertTargetList, tle);
620 need_projection =
true;
690 Assert(whichrel >= 0 && whichrel < mtstate->mt_nrels);
842 resultRelInfo = partRelInfo;
853 if (resultRelationDesc->
rd_rel->relhasindex &&
906 bool flushed =
false;
924 if (resultRelInfo->
ri_Slots == NULL)
1065 if (resultRelationDesc->
rd_rel->relispartition &&
1078 List *arbiterIndexes;
1098 specConflict =
false;
1100 &conflictTid, &invalidItemPtr,
1115 &conflictTid, slot, canSetTag,
1162 slot, estate,
false,
true,
1169 specToken, !specConflict);
1203 slot, estate,
false,
1235 ar_insert_trig_tcs = NULL;
1240 ar_insert_trig_tcs);
1282 if (tupconv_map != NULL)
1295 oldSlot, slot, planSlot);
1313 *inserted_tuple = slot;
1315 *insert_destrel = resultRelInfo;
1338 int numInserted = numSlots;
1351 for (
i = 0;
i < numInserted;
i++)
1373 if (canSetTag && numInserted > 0)
1377 for (
i = 0;
i < numSlots;
i++)
1438 resultRelInfo, tupleid, oldtuple,
1439 epqreturnslot, result, &context->
tmfd);
1502 ar_delete_trig_tcs = NULL;
1507 ar_delete_trig_tcs, changingPart);
1537 bool processReturning,
1551 *tupleDeleted =
false;
1558 epqreturnslot, tmresult))
1567 Assert(oldtuple != NULL);
1611 result =
ExecDeleteAct(context, resultRelInfo, tupleid, changingPart);
1646 (
errcode(ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION),
1647 errmsg(
"tuple to be deleted was already modified by an operation triggered by the current command"),
1648 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
1664 errmsg(
"could not serialize access due to concurrent update")));
1699 *epqreturnslot = epqslot;
1720 (
errcode(ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION),
1721 errmsg(
"tuple to be deleted was already modified by an operation triggered by the current command"),
1722 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
1741 elog(
ERROR,
"unexpected table_tuple_lock status: %u",
1754 errmsg(
"could not serialize access due to concurrent delete")));
1759 elog(
ERROR,
"unrecognized table_tuple_delete status: %u",
1779 *tupleDeleted =
true;
1809 if (oldtuple != NULL)
1817 elog(
ERROR,
"failed to fetch deleted tuple for DELETE RETURNING");
1835 if (tupconv_map != NULL)
1919 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1920 errmsg(
"invalid ON UPDATE specification"),
1921 errdetail(
"The result tuple would appear in a different partition than the original tuple.")));
1962 tmresult, &tuple_deleted, &epqslot);
1994 return *tmresult ==
TM_Ok;
2010 elog(
ERROR,
"failed to fetch tuple being updated");
2024 if (tupconv_map != NULL)
2032 inserted_tuple, insert_destrel);
2068 if (resultRelationDesc->
rd_rel->relhasindex &&
2081 resultRelInfo, tupleid, oldtuple, slot,
2082 result, &context->
tmfd);
2136 bool partition_constraint_failed;
2161 partition_constraint_failed =
2162 resultRelationDesc->
rd_rel->relispartition &&
2166 if (!partition_constraint_failed &&
2174 resultRelInfo, slot, estate);
2181 if (partition_constraint_failed)
2194 tupleid, oldtuple, slot,
2195 canSetTag, updateCxt,
2218 if (insert_destrel &&
2299 tupleid, oldtuple, slot,
2349 foreach(lc, ancestorRels)
2353 bool has_noncloned_fkey =
false;
2356 if (rInfo == rootRelInfo)
2368 has_noncloned_fkey =
true;
2374 if (has_noncloned_fkey)
2376 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2377 errmsg(
"cannot move tuple across partitions when a non-root ancestor of the source partition is directly referenced in a foreign key"),
2378 errdetail(
"A foreign key points to ancestor \"%s\" but not the root ancestor \"%s\".",
2381 errhint(
"Consider defining the foreign key on table \"%s\".",
2387 rootRelInfo, sourcePartInfo, destPartInfo,
2388 tupleid, NULL, newslot,
NIL, NULL,
true);
2434 elog(
ERROR,
"cannot UPDATE during bootstrap");
2486 lockedtid = *tupleid;
2487 result =
ExecUpdateAct(context, resultRelInfo, tupleid, oldtuple, slot,
2488 canSetTag, &updateCxt);
2527 (
errcode(ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION),
2528 errmsg(
"tuple to be updated was already modified by an operation triggered by the current command"),
2529 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
2545 errmsg(
"could not serialize access due to concurrent update")));
2593 elog(
ERROR,
"failed to fetch tuple being updated");
2617 (
errcode(ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION),
2618 errmsg(
"tuple to be updated was already modified by an operation triggered by the current command"),
2619 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
2624 elog(
ERROR,
"unexpected table_tuple_lock status: %u",
2636 errmsg(
"could not serialize access due to concurrent delete")));
2641 elog(
ERROR,
"unrecognized table_tuple_update status: %u",
2746 (
errcode(ERRCODE_CARDINALITY_VIOLATION),
2748 errmsg(
"%s command cannot affect row a second time",
2749 "ON CONFLICT DO UPDATE"),
2750 errhint(
"Ensure that no rows proposed for insertion within the same command have duplicate constrained values.")));
2753 elog(
ERROR,
"attempted to lock invisible tuple");
2763 elog(
ERROR,
"unexpected self-updated tuple");
2770 errmsg(
"could not serialize access due to concurrent update")));
2794 errmsg(
"could not serialize access due to concurrent delete")));
2802 elog(
ERROR,
"unrecognized table_tuple_lock status: %u",
test);
2833 if (!
ExecQual(onConflictSetWhere, econtext))
2875 *returning =
ExecUpdate(context, resultRelInfo,
2876 conflictTid, NULL, existing,
2887 if (*returning != NULL &&
2967 matched = tupleid != NULL || oldtuple != NULL;
2970 canSetTag, &matched);
3068 Assert(tupleid != NULL || oldtuple != NULL);
3070 if (oldtuple != NULL)
3087 lockedtid = *tupleid;
3093 elog(
ERROR,
"failed to fetch the target tuple");
3111 foreach(l, actionStates)
3150 switch (commandType)
3163 tupleid, NULL, newslot, &result))
3165 if (result ==
TM_Ok)
3182 Assert(oldtuple == NULL);
3185 NULL, newslot, canSetTag,
3205 if (result ==
TM_Ok)
3208 tupleid, NULL, newslot);
3216 NULL, NULL, &result))
3218 if (result ==
TM_Ok)
3235 Assert(oldtuple == NULL);
3241 if (result ==
TM_Ok)
3255 elog(
ERROR,
"unknown action in MERGE WHEN clause");
3289 (
errcode(ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION),
3290 errmsg(
"tuple to be updated or deleted was already modified by an operation triggered by the current command"),
3291 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
3295 (
errcode(ERRCODE_CARDINALITY_VIOLATION),
3297 errmsg(
"%s command cannot affect row a second time",
3299 errhint(
"Ensure that not more than one source row matches any one target row.")));
3302 elog(
ERROR,
"attempted to update or delete invisible tuple");
3309 errmsg(
"could not serialize access due to concurrent delete")));
3368 errmsg(
"tuple to be merged was already moved to another partition due to concurrent update")));
3421 elog(
ERROR,
"failed to fetch the target tuple");
3436 goto lmerge_matched;
3459 (
errcode(ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION),
3460 errmsg(
"tuple to be updated or deleted was already modified by an operation triggered by the current command"),
3461 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
3465 (
errcode(ERRCODE_CARDINALITY_VIOLATION),
3467 errmsg(
"%s command cannot affect row a second time",
3469 errhint(
"Ensure that not more than one source row matches any one target row.")));
3472 elog(
ERROR,
"attempted to update or delete invisible tuple");
3477 elog(
ERROR,
"unexpected table_tuple_lock status: %u",
3487 elog(
ERROR,
"unexpected tuple operation result: %d", result);
3494 switch (commandType)
3518 elog(
ERROR,
"unrecognized commandType: %d",
3573 foreach(l, actionStates)
3590 switch (commandType)
3603 newslot, canSetTag, NULL, NULL);
3610 elog(
ERROR,
"unknown action in MERGE WHEN NOT MATCHED clause");
3656 Node *joinCondition;
3666 if (
unlikely(!resultRelInfo->ri_projectNewInfoValid))
3670 resultRelInfo->ri_MergeJoinCondition =
3673 foreach(l, mergeActionList)
3693 resultRelInfo->ri_MergeActions[
action->matchKind] =
3697 switch (
action->commandType)
3714 if (rootRelInfo->ri_RelationDesc->rd_rel->relkind ==
3715 RELKIND_PARTITIONED_TABLE)
3732 rootRelInfo->ri_RelationDesc);
3740 tgtslot = resultRelInfo->ri_newTupleSlot;
3759 resultRelInfo->ri_newTupleSlot,
3942 bool has_before_insert_row_trig;
3944 has_before_insert_row_trig = (partrel->
ri_TrigDesc &&
3948 !has_before_insert_row_trig ? slot : NULL;
3962 *partRelInfo = partrel;
4002 elog(
ERROR,
"ModifyTable should not be called during EvalPlanQual");
4182 if (relkind == RELKIND_RELATION ||
4183 relkind == RELKIND_MATVIEW ||
4184 relkind == RELKIND_PARTITIONED_TABLE)
4223 tuple_ctid = *tupleid;
4224 tupleid = &tuple_ctid;
4288 oldtuple = &oldtupdata;
4293 Assert(relkind == RELKIND_FOREIGN_TABLE);
4304 slot =
ExecInsert(&context, resultRelInfo, slot,
4320 if (oldtuple != NULL)
4339 elog(
ERROR,
"failed to fetch tuple being updated");
4345 slot =
ExecUpdate(&context, resultRelInfo, tupleid, oldtuple,
4353 slot =
ExecDelete(&context, resultRelInfo, tupleid, oldtuple,
4354 true,
false, node->
canSetTag, NULL, NULL, NULL);
4358 slot =
ExecMerge(&context, resultRelInfo, tupleid, oldtuple,
4403 bool missing_ok,
bool update_cache)
4425 for (
int ndx = 0; ndx < node->
mt_nrels; ndx++)
4442 elog(
ERROR,
"incorrect result relation OID %u", resultoid);
4577 for (
i = 0;
i < nrels;
i++)
4607 if (relkind == RELKIND_RELATION ||
4608 relkind == RELKIND_MATVIEW ||
4609 relkind == RELKIND_PARTITIONED_TABLE)
4614 elog(
ERROR,
"could not find junk ctid column");
4616 else if (relkind == RELKIND_FOREIGN_TABLE)
4635 elog(
ERROR,
"could not find junk wholerow column");
4644 elog(
ERROR,
"could not find junk wholerow column");
4670 if (rel->
rd_rel->relkind == RELKIND_PARTITIONED_TABLE &&
4685 foreach(ll, wcoList)
4691 wcoExprs =
lappend(wcoExprs, wcoExpr);
4834 arowmarks =
lappend(arowmarks, aerm);
4851#ifdef USE_ASSERT_CHECKING
4852#define MT_NRELS_HASH 4
4854#define MT_NRELS_HASH 64
4867 for (
i = 0;
i < nrels;
i++)
4996 elog(
ERROR,
"ExecReScanModifyTable is not implemented");
#define AttributeNumberIsValid(attributeNumber)
bool bms_is_member(int x, const Bitmapset *a)
Bitmapset * bms_add_member(Bitmapset *a, int x)
bool bms_overlap(const Bitmapset *a, const Bitmapset *b)
static Datum values[MAXATTR]
#define Assert(condition)
Datum datumCopy(Datum value, bool typByVal, int typLen)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent, TupleDesc inputDesc)
ExprState * ExecInitQual(List *qual, PlanState *parent)
ProjectionInfo * ExecBuildUpdateProjection(List *targetList, bool evalTargetList, List *targetColnos, TupleDesc relDesc, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent)
void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative)
bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, ItemPointer tupleid, List *arbiterIndexes)
List * ExecInsertIndexTuples(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool update, bool noDupErr, bool *specConflict, List *arbiterIndexes, bool onlySummarizing)
AttrNumber ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo)
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation, List *mergeActions)
TupleTableSlot * EvalPlanQualSlot(EPQState *epqstate, Relation relation, Index rti)
void EvalPlanQualBegin(EPQState *epqstate)
bool ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool emitError)
void EvalPlanQualInit(EPQState *epqstate, EState *parentestate, Plan *subplan, List *auxrowmarks, int epqParam, List *resultRelations)
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
void EvalPlanQualEnd(EPQState *epqstate)
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
TupleTableSlot * EvalPlanQual(EPQState *epqstate, Relation relation, Index rti, TupleTableSlot *inputslot)
void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
List * ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo)
PartitionTupleRouting * ExecSetupPartitionTupleRouting(EState *estate, Relation rel)
ResultRelInfo * ExecFindPartition(ModifyTableState *mtstate, ResultRelInfo *rootResultRelInfo, PartitionTupleRouting *proute, TupleTableSlot *slot, EState *estate)
void ExecCleanupTupleRouting(ModifyTableState *mtstate, PartitionTupleRouting *proute)
void ExecEndNode(PlanState *node)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
const TupleTableSlotOps TTSOpsVirtual
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
TupleTableSlot * ExecStoreVirtualTuple(TupleTableSlot *slot)
void ExecInitResultTypeTL(PlanState *planstate)
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
TupleTableSlot * ExecStoreAllNullTuple(TupleTableSlot *slot)
void ExecForceStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
TupleConversionMap * ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate)
TupleConversionMap * ExecGetChildToRootMap(ResultRelInfo *resultRelInfo)
Bitmapset * ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate)
void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo, Index rti)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
TupleTableSlot * ExecGetAllNullSlot(EState *estate, ResultRelInfo *relInfo)
TupleTableSlot * ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo)
#define InstrCountFiltered1(node, delta)
#define outerPlanState(node)
#define InstrCountTuples2(node, delta)
#define EEO_FLAG_NEW_IS_NULL
#define EEO_FLAG_OLD_IS_NULL
#define EXEC_FLAG_BACKWARD
#define ResetPerTupleExprContext(estate)
static TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
#define GetPerTupleExprContext(estate)
#define ResetExprContext(econtext)
#define GetPerTupleMemoryContext(estate)
static bool ExecQual(ExprState *state, ExprContext *econtext)
static TupleTableSlot * ExecProcNode(PlanState *node)
#define EvalPlanQualSetSlot(epqstate, slot)
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
#define EXEC_FLAG_EXPLAIN_ONLY
static Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
#define DatumGetHeapTupleHeader(X)
#define HeapTupleHeaderGetDatumLength(tup)
if(TABLE==NULL||TABLE_index==NULL)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
static bool ItemPointerIndicatesMovedPartitions(const ItemPointerData *pointer)
ItemPointerData * ItemPointer
static void ItemPointerCopy(const ItemPointerData *fromPointer, ItemPointerData *toPointer)
static bool ItemPointerIsValid(const ItemPointerData *pointer)
List * lappend(List *list, void *datum)
List * lcons(void *datum, List *list)
bool list_member_ptr(const List *list, const void *datum)
void list_free(List *list)
void LockTuple(Relation relation, ItemPointer tid, LOCKMODE lockmode)
uint32 SpeculativeInsertionLockAcquire(TransactionId xid)
void SpeculativeInsertionLockRelease(TransactionId xid)
void UnlockTuple(Relation relation, ItemPointer tid, LOCKMODE lockmode)
#define InplaceUpdateTupleLock
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
#define IsBootstrapProcessingMode()
#define CHECK_FOR_INTERRUPTS()
Oid exprType(const Node *expr)
static void ExecInitInsertProjection(ModifyTableState *mtstate, ResultRelInfo *resultRelInfo)
ResultRelInfo * ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid, bool missing_ok, bool update_cache)
static void ExecPendingInserts(EState *estate)
static void ExecSetupTransitionCaptureState(ModifyTableState *mtstate, EState *estate)
void ExecInitMergeTupleSlots(ModifyTableState *mtstate, ResultRelInfo *resultRelInfo)
struct ModifyTableContext ModifyTableContext
static void ExecUpdatePrepareSlot(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
static TupleTableSlot * ExecInsert(ModifyTableContext *context, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, bool canSetTag, TupleTableSlot **inserted_tuple, ResultRelInfo **insert_destrel)
ModifyTableState * ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
static TupleTableSlot * ExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, bool canSetTag, bool *matched)
static TupleTableSlot * ExecModifyTable(PlanState *pstate)
void ExecInitStoredGenerated(ResultRelInfo *resultRelInfo, EState *estate, CmdType cmdtype)
static bool ExecDeletePrologue(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, TupleTableSlot **epqreturnslot, TM_Result *result)
static void ExecCheckPlanOutput(Relation resultRel, List *targetList)
TupleTableSlot * ExecGetUpdateNewTuple(ResultRelInfo *relinfo, TupleTableSlot *planSlot, TupleTableSlot *oldSlot)
static void ExecCrossPartitionUpdateForeignKey(ModifyTableContext *context, ResultRelInfo *sourcePartInfo, ResultRelInfo *destPartInfo, ItemPointer tupleid, TupleTableSlot *oldslot, TupleTableSlot *newslot)
static void ExecInitUpdateProjection(ModifyTableState *mtstate, ResultRelInfo *resultRelInfo)
static void ExecCheckTIDVisible(EState *estate, ResultRelInfo *relinfo, ItemPointer tid, TupleTableSlot *tempSlot)
static TM_Result ExecDeleteAct(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, bool changingPart)
static void ExecCheckTupleVisible(EState *estate, Relation rel, TupleTableSlot *slot)
static TupleTableSlot * ExecUpdate(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, TupleTableSlot *oldSlot, TupleTableSlot *slot, bool canSetTag)
void ExecComputeStoredGenerated(ResultRelInfo *resultRelInfo, EState *estate, TupleTableSlot *slot, CmdType cmdtype)
static TupleTableSlot * ExecPrepareTupleRouting(ModifyTableState *mtstate, EState *estate, PartitionTupleRouting *proute, ResultRelInfo *targetRelInfo, TupleTableSlot *slot, ResultRelInfo **partRelInfo)
static TupleTableSlot * ExecGetInsertNewTuple(ResultRelInfo *relinfo, TupleTableSlot *planSlot)
struct MTTargetRelLookup MTTargetRelLookup
struct UpdateContext UpdateContext
static TM_Result ExecUpdateAct(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, TupleTableSlot *slot, bool canSetTag, UpdateContext *updateCxt)
static void ExecUpdateEpilogue(ModifyTableContext *context, UpdateContext *updateCxt, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, TupleTableSlot *slot)
static void fireBSTriggers(ModifyTableState *node)
void ExecReScanModifyTable(ModifyTableState *node)
static TupleTableSlot * ExecDelete(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, bool processReturning, bool changingPart, bool canSetTag, TM_Result *tmresult, bool *tupleDeleted, TupleTableSlot **epqreturnslot)
void ExecEndModifyTable(ModifyTableState *node)
static void fireASTriggers(ModifyTableState *node)
static bool ExecOnConflictUpdate(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer conflictTid, TupleTableSlot *excludedSlot, bool canSetTag, TupleTableSlot **returning)
static void ExecBatchInsert(ModifyTableState *mtstate, ResultRelInfo *resultRelInfo, TupleTableSlot **slots, TupleTableSlot **planSlots, int numSlots, EState *estate, bool canSetTag)
static bool ExecUpdatePrologue(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, TupleTableSlot *slot, TM_Result *result)
static void ExecDeleteEpilogue(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, bool changingPart)
static TupleTableSlot * ExecMergeNotMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo, bool canSetTag)
static TupleTableSlot * ExecProcessReturning(ModifyTableContext *context, ResultRelInfo *resultRelInfo, CmdType cmdType, TupleTableSlot *oldSlot, TupleTableSlot *newSlot, TupleTableSlot *planSlot)
static TupleTableSlot * ExecMerge(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, bool canSetTag)
static bool ExecCrossPartitionUpdate(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, TupleTableSlot *slot, bool canSetTag, UpdateContext *updateCxt, TM_Result *tmresult, TupleTableSlot **retry_slot, TupleTableSlot **inserted_tuple, ResultRelInfo **insert_destrel)
static void ExecInitMerge(ModifyTableState *mtstate, EState *estate)
#define IsA(nodeptr, _type_)
#define castNode(_type_, nodeptr)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
@ WCO_RLS_MERGE_UPDATE_CHECK
@ WCO_RLS_MERGE_DELETE_CHECK
FormData_pg_attribute * Form_pg_attribute
#define lfirst_node(type, lc)
static int list_length(const List *l)