228 foreach(
lc, targetList)
235 if (attno >= resultDesc->
natts)
238 errmsg(
"table row type and query-specified row type do not match"),
239 errdetail(
"Query has too many columns.")));
246 if (attr->attisdropped)
254 !((
Const *)
tle->expr)->constisnull)
257 errmsg(
"table row type and query-specified row type do not match"),
258 errdetail(
"Query provides a value for a dropped column at ordinal position %d.",
261 else if (attr->attgenerated)
271 !((
Const *)
tle->expr)->constisnull)
274 errmsg(
"table row type and query-specified row type do not match"),
275 errdetail(
"Query provides a value for a generated column at ordinal position %d.",
284 errmsg(
"table row type and query-specified row type do not match"),
285 errdetail(
"Table has type %s at ordinal position %d, but query expects %s.",
291 if (attno != resultDesc->
natts)
294 errmsg(
"table row type and query-specified row type do not match"),
295 errdetail(
"Query has too few columns.")));
413 errmsg(
"could not serialize access due to concurrent update")));
433 elog(
ERROR,
"failed to fetch conflicting tuple for ON CONFLICT");
460 int natts = tupdesc->
natts;
491 for (
int i = 0;
i < natts;
i++)
502 elog(
ERROR,
"no generation expression found for column number %d of table \"%s\"",
574 int natts = tupdesc->
natts;
613 for (
int i = 0;
i < natts;
i++)
808 return relinfo->ri_newTupleSlot;
821 econtext =
newProj->pi_exprContext;
848 econtext =
newProj->pi_exprContext;
1138 List *arbiterIndexes;
1244 slot, arbiterIndexes,
1454 elog(
ERROR,
"failed to fetch tuple for FOR PORTION OF");
1460 elog(
ERROR,
"found a NULL range in a temporal table");
1468 typcache =
fpoState->fp_leftoverstypcache;
1469 if (typcache ==
NULL)
1472 fpoState->fp_leftoverstypcache = typcache;
1494 fcinfo->args[0].isnull =
false;
1495 fcinfo->args[1].value =
fpoState->fp_targetRange;
1496 fcinfo->args[1].isnull =
false;
1524 fcinfo->isnull =
false;
1532 elog(
ERROR,
"without_portion function violated function call protocol");
1539 elog(
ERROR,
"got a null from without_portion function");
1742 resultRelInfo,
tupleid, oldtuple,
1961 errmsg(
"tuple to be deleted was already modified by an operation triggered by the current command"),
1962 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
1978 errmsg(
"could not serialize access due to concurrent update")));
2035 errmsg(
"tuple to be deleted was already modified by an operation triggered by the current command"),
2036 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
2055 elog(
ERROR,
"unexpected table_tuple_lock status: %u",
2068 errmsg(
"could not serialize access due to concurrent delete")));
2073 elog(
ERROR,
"unrecognized table_tuple_delete status: %u",
2123 if (oldtuple !=
NULL)
2131 elog(
ERROR,
"failed to fetch deleted tuple for DELETE RETURNING");
2234 errmsg(
"invalid ON UPDATE specification"),
2235 errdetail(
"The result tuple would appear in a different partition than the original tuple.")));
2327 elog(
ERROR,
"failed to fetch tuple being updated");
2398 resultRelInfo,
tupleid, oldtuple, slot,
2492 resultRelInfo, slot, estate);
2693 if (!
trig->tgisclone &&
2705 errmsg(
"cannot move tuple across partitions when a non-root ancestor of the source partition is directly referenced in a foreign key"),
2706 errdetail(
"A foreign key points to ancestor \"%s\" but not the root ancestor \"%s\".",
2709 errhint(
"Consider defining the foreign key on table \"%s\".",
2762 elog(
ERROR,
"cannot UPDATE during bootstrap");
2856 errmsg(
"tuple to be updated was already modified by an operation triggered by the current command"),
2857 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
2873 errmsg(
"could not serialize access due to concurrent update")));
2921 elog(
ERROR,
"failed to fetch tuple being updated");
2946 errmsg(
"tuple to be updated was already modified by an operation triggered by the current command"),
2947 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
2952 elog(
ERROR,
"unexpected table_tuple_lock status: %u",
2964 errmsg(
"could not serialize access due to concurrent delete")));
2969 elog(
ERROR,
"unrecognized table_tuple_update status: %u",
3057 errmsg(
"%s command cannot affect row a second time",
3058 isUpdate ?
"ON CONFLICT DO UPDATE" :
"ON CONFLICT DO SELECT"),
3059 errhint(
"Ensure that no rows proposed for insertion within the same command have duplicate constrained values.")));
3062 elog(
ERROR,
"attempted to lock invisible tuple");
3072 elog(
ERROR,
"unexpected self-updated tuple");
3079 errmsg(
"could not serialize access due to concurrent update")));
3095 errmsg(
"could not serialize access due to concurrent delete")));
3102 elog(
ERROR,
"unrecognized table_tuple_lock status: %u",
test);
3221 *returning =
ExecUpdate(context, resultRelInfo,
3233 if (*returning !=
NULL &&
3282 elog(
ERROR,
"failed to fetch conflicting tuple for ON CONFLICT");
3288 switch (lockStrength)
3303 elog(
ERROR,
"Unexpected lock strength %d", (
int) lockStrength);
3451 canSetTag, &matched);
3551 if (oldtuple !=
NULL)
3574 elog(
ERROR,
"failed to fetch the target tuple");
3631 switch (commandType)
3736 elog(
ERROR,
"unknown action in MERGE WHEN clause");
3771 errmsg(
"tuple to be updated or deleted was already modified by an operation triggered by the current command"),
3772 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
3778 errmsg(
"%s command cannot affect row a second time",
3780 errhint(
"Ensure that not more than one source row matches any one target row.")));
3783 elog(
ERROR,
"attempted to update or delete invisible tuple");
3790 errmsg(
"could not serialize access due to concurrent delete")));
3810 errmsg(
"could not serialize access due to concurrent update")));
3854 errmsg(
"tuple to be merged was already moved to another partition due to concurrent update")));
3908 elog(
ERROR,
"failed to fetch the target tuple");
3968 errmsg(
"tuple to be updated or deleted was already modified by an operation triggered by the current command"),
3969 errhint(
"Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows.")));
3975 errmsg(
"%s command cannot affect row a second time",
3977 errhint(
"Ensure that not more than one source row matches any one target row.")));
3980 elog(
ERROR,
"attempted to update or delete invisible tuple");
3985 elog(
ERROR,
"unexpected table_tuple_lock status: %u",
4002 switch (commandType)
4026 elog(
ERROR,
"unrecognized commandType: %d",
4084 CmdType commandType = action->mas_action->commandType;
4094 if (!
ExecQual(action->mas_whenqual, econtext))
4098 switch (commandType)
4118 elog(
ERROR,
"unknown action in MERGE WHEN NOT MATCHED clause");
4145 if (mergeActionLists ==
NIL)
4162 foreach(
lc, mergeActionLists)
4165 Node *joinCondition;
4182 foreach(l, mergeActionList)
4206 switch (action->commandType)
4211 action->targetList);
4224 if (
rootRelInfo->ri_RelationDesc->rd_rel->relkind ==
4280 action->updateColnos,
4293 elog(
ERROR,
"unknown action in MERGE WHEN clause");
4320 bool found_whole_row;
4368 List *returningList;
4389 returningList = (
List *)
4634 elog(
ERROR,
"ModifyTable should not be called during EvalPlanQual");
4951 slot =
ExecInsert(&context, resultRelInfo, slot,
4967 if (oldtuple !=
NULL)
4986 elog(
ERROR,
"failed to fetch tuple being updated");
5106 List *withCheckOptionLists =
NIL;
5108 List *updateColnosLists =
NIL;
5110 List *mergeJoinConditions =
NIL;
5153 resultRelations =
lappend_int(resultRelations, rti);
5168 returningLists =
lappend(returningLists, returningList);
5180 mergeActionLists =
lappend(mergeActionLists, mergeActionList);
5186 mergeJoinConditions =
lappend(mergeJoinConditions, mergeJoinCondition);
5268 foreach(l, resultRelations)
5273 if (mergeActionLists)
5311 for (
i = 0;
i < nrels;
i++)
5357 elog(
ERROR,
"could not find junk ctid column");
5378 elog(
ERROR,
"could not find junk wholerow column");
5387 elog(
ERROR,
"could not find junk wholerow column");
5422 foreach(l, withCheckOptionLists)
5468 foreach(l, returningLists)
5562 onconfl->oc_WhereClause = qualexpr;
5601 (
errmsg(
"FOR PORTION OF target was null")),
5610 fpoState->fp_targetRange = targetRange;
5714#ifdef USE_ASSERT_CHECKING
5715#define MT_NRELS_HASH 4
5717#define MT_NRELS_HASH 64
5730 for (
i = 0;
i < nrels;
i++)
5859 elog(
ERROR,
"ExecReScanModifyTable is not implemented");
5884 elog(
ERROR,
"no root relation but ri_forPortionOf is uninitialized");
AttrMap * build_attrmap_by_name(TupleDesc indesc, TupleDesc outdesc, bool missing_ok)
#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)
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
static DataChecksumsWorkerOperation operation
Datum datumCopy(Datum value, bool typByVal, int typLen)
void domain_check(Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, int64 nelem, const HASHCTL *info, int flags)
int errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
#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)
List * ExecInsertIndexTuples(ResultRelInfo *resultRelInfo, EState *estate, uint32 flags, TupleTableSlot *slot, List *arbiterIndexes, bool *specConflict)
void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative)
bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, const ItemPointerData *tupleid, List *arbiterIndexes)
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)
TupleTableSlot * EvalPlanQualSlot(EPQState *epqstate, Relation relation, Index rti)
void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation, OnConflictAction onConflictAction, List *mergeActions)
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)
HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree)
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
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)
int executor_errposition(EState *estate, int location)
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)
static RangeTblEntry * exec_rt_fetch(Index rti, EState *estate)
#define ResetExprContext(econtext)
#define GetPerTupleMemoryContext(estate)
#define EIIT_ONLY_SUMMARIZING
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 EIIT_NO_DUPE_ERROR
#define palloc_array(type, count)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
#define DatumGetHeapTupleHeader(X)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
#define LOCAL_FCINFO(name, nargs)
#define FunctionCallInvoke(fcinfo)
void heap_freetuple(HeapTuple htup)
static uint32 HeapTupleHeaderGetDatumLength(const HeapTupleHeaderData *tup)
#define INJECTION_POINT(name, arg)
void InstrUpdateTupleCount(NodeInstrumentation *instr, double nTuples)
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 * lappend_int(List *list, int datum)
List * lcons(void *datum, List *list)
bool list_member_ptr(const List *list, const void *datum)
void list_free(List *list)
void UnlockTuple(Relation relation, const ItemPointerData *tid, LOCKMODE lockmode)
uint32 SpeculativeInsertionLockAcquire(TransactionId xid)
void SpeculativeInsertionLockRelease(TransactionId xid)
void LockTuple(Relation relation, const ItemPointerData *tid, LOCKMODE lockmode)
#define InplaceUpdateTupleLock
@ LockTupleNoKeyExclusive
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
#define IsBootstrapProcessingMode()
#define CHECK_FOR_INTERRUPTS()
Oid exprType(const Node *expr)
static bool ExecOnConflictSelect(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer conflictTid, TupleTableSlot *excludedSlot, bool canSetTag, TupleTableSlot **returning)
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)
static void ExecForPortionOfLeftovers(ModifyTableContext *context, EState *estate, ResultRelInfo *resultRelInfo, ItemPointer tupleid)
void ExecInitMergeTupleSlots(ModifyTableState *mtstate, ResultRelInfo *resultRelInfo)
static void ExecInitForPortionOf(ModifyTableState *mtstate, EState *estate, ResultRelInfo *resultRelInfo)
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)
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)
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)
void ExecInitGenerated(ResultRelInfo *resultRelInfo, EState *estate, CmdType cmdtype)
static bool ExecOnConflictLockRow(ModifyTableContext *context, TupleTableSlot *existing, ItemPointer conflictTid, Relation relation, LockTupleMode lockmode, bool isUpdate)
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 * ExecMerge(ModifyTableContext *context, ResultRelInfo *resultRelInfo, ItemPointer tupleid, HeapTuple oldtuple, bool canSetTag)
static TupleTableSlot * ExecProcessReturning(ModifyTableContext *context, ResultRelInfo *resultRelInfo, bool isDelete, TupleTableSlot *oldSlot, TupleTableSlot *newSlot, TupleTableSlot *planSlot)
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)
#define forboth(cell1, list1, cell2, list2)
static void * list_nth(const List *list, int n)
#define list_nth_node(type, list, n)
#define ERRCODE_T_R_SERIALIZATION_FAILURE
void pgstat_init_function_usage(FunctionCallInfo fcinfo, PgStat_FunctionCallUsage *fcu)
void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize)
static Oid DatumGetObjectId(Datum X)
static Pointer DatumGetPointer(Datum X)
static TransactionId DatumGetTransactionId(Datum X)
@ MERGE_WHEN_NOT_MATCHED_BY_TARGET
@ MERGE_WHEN_NOT_MATCHED_BY_SOURCE
#define RelationGetForm(relation)
#define RelationGetRelid(relation)
#define RelationGetDescr(relation)
#define RelationGetRelationName(relation)
Node * build_column_default(Relation rel, int attrno)
Node * map_variable_attnos(Node *node, int target_varno, int sublevels_up, const AttrMap *attno_map, Oid to_rowtype, bool *found_whole_row)
int RI_FKey_trigger_type(Oid tgfoid)
Bitmapset * es_unpruned_relids
List * es_insert_pending_result_relations
MemoryContext es_query_cxt
struct EPQState * es_epq_active
List * es_insert_pending_modifytables
List * es_auxmodifytables
Snapshot es_crosscheck_snapshot
TupleTableSlot * ecxt_innertuple
TupleTableSlot * ecxt_newtuple
TupleTableSlot * ecxt_scantuple
TupleTableSlot * ecxt_oldtuple
TupleTableSlot * ecxt_outertuple
BeginForeignModify_function BeginForeignModify
EndForeignModify_function EndForeignModify
ExecForeignInsert_function ExecForeignInsert
ExecForeignUpdate_function ExecForeignUpdate
ExecForeignBatchInsert_function ExecForeignBatchInsert
GetForeignModifyBatchSize_function GetForeignModifyBatchSize
ExecForeignDelete_function ExecForeignDelete
TupleTableSlot * fp_Existing
ProjectionInfo * mas_proj
TupleTableSlot * planSlot
TupleTableSlot * cpDeletedSlot
TupleTableSlot * cpUpdateReturningSlot
ModifyTableState * mtstate
List * mt_mergeJoinConditions
TupleTableSlot * mt_merge_pending_not_matched
ResultRelInfo * resultRelInfo
struct PartitionTupleRouting * mt_partition_tuple_routing
List * mt_updateColnosLists
TupleTableSlot * mt_root_tuple_slot
List * mt_mergeActionLists
ResultRelInfo * rootResultRelInfo
struct TransitionCaptureState * mt_transition_capture
struct TransitionCaptureState * mt_oc_transition_capture
MergeActionState * mt_merge_action
List * mergeJoinConditions
Bitmapset * fdwDirectModifyPlans
List * withCheckOptionLists
LockClauseStrength onConflictLockStrength
OnConflictAction onConflictAction
ExprState * oc_WhereClause
ProjectionInfo * oc_ProjInfo
TupleTableSlot * oc_ProjSlot
TupleTableSlot * oc_Existing
LockClauseStrength oc_LockStrength
ExprContext * ps_ExprContext
TupleTableSlot * ps_ResultTupleSlot
ExecProcNodeMtd ExecProcNode
OnConflictActionState * ri_onConflict
TupleTableSlot * ri_PartitionTupleSlot
bool ri_projectNewInfoValid
List * ri_onConflictArbiterIndexes
struct ResultRelInfo * ri_RootResultRelInfo
TupleTableSlot ** ri_Slots
ExprState * ri_MergeJoinCondition
RelationPtr ri_IndexRelationDescs
int ri_NumSlotsInitialized
List * ri_WithCheckOptions
TupleTableSlot * ri_oldTupleSlot
bool ri_extraUpdatedCols_valid
TriggerDesc * ri_TrigDesc
ForPortionOfState * ri_forPortionOf
Bitmapset * ri_extraUpdatedCols
ExprState ** ri_GeneratedExprsI
int ri_NumGeneratedNeededU
List * ri_MergeActions[NUM_MERGE_MATCH_KINDS]
TupleTableSlot * ri_newTupleSlot
List * ri_WithCheckOptionExprs
ProjectionInfo * ri_projectNew
ProjectionInfo * ri_projectReturning
ExprState ** ri_GeneratedExprsU
struct FdwRoutine * ri_FdwRoutine
TupleTableSlot ** ri_PlanSlots
bool ri_usesFdwDirectModify
int ri_NumGeneratedNeededI
SetFunctionReturnMode returnMode
Tuplestorestate * setResult
TupleTableSlot * tcs_original_insert_tuple
bool tcs_update_new_table
bool tcs_update_old_table
bool trig_delete_before_row
bool trig_update_instead_row
bool trig_delete_instead_row
bool trig_update_after_row
bool trig_insert_instead_row
bool trig_update_before_row
bool trig_insert_before_row
bool has_generated_virtual
bool has_generated_stored
TupleDesc tts_tupleDescriptor
const TupleTableSlotOps *const tts_ops
TU_UpdateIndexes updateIndexes
#define MinTransactionIdAttributeNumber
#define FirstLowInvalidHeapAttributeNumber
TupleTableSlot * table_slot_create(Relation relation, List **reglist)
static TM_Result table_tuple_lock(Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy, uint8 flags, TM_FailureData *tmfd)
static void table_tuple_insert_speculative(Relation rel, TupleTableSlot *slot, CommandId cid, uint32 options, BulkInsertStateData *bistate, uint32 specToken)
static void table_tuple_complete_speculative(Relation rel, TupleTableSlot *slot, uint32 specToken, bool succeeded)
#define TUPLE_LOCK_FLAG_FIND_LAST_VERSION
#define TABLE_DELETE_CHANGING_PARTITION
static void table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid, uint32 options, BulkInsertStateData *bistate)
static TM_Result table_tuple_update(Relation rel, ItemPointer otid, TupleTableSlot *slot, CommandId cid, uint32 options, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, LockTupleMode *lockmode, TU_UpdateIndexes *update_indexes)
static TM_Result table_tuple_delete(Relation rel, ItemPointer tid, CommandId cid, uint32 options, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd)
static bool table_tuple_satisfies_snapshot(Relation rel, TupleTableSlot *slot, Snapshot snapshot)
static bool table_tuple_fetch_row_version(Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot)
bool ExecBRUpdateTriggers(EState *estate, EPQState *epqstate, ResultRelInfo *relinfo, ItemPointer tupleid, HeapTuple fdw_trigtuple, TupleTableSlot *newslot, TM_Result *tmresult, TM_FailureData *tmfd, bool is_merge_update)
TransitionCaptureState * MakeTransitionCaptureState(TriggerDesc *trigdesc, Oid relid, CmdType cmdType)
void ExecARDeleteTriggers(EState *estate, ResultRelInfo *relinfo, ItemPointer tupleid, HeapTuple fdw_trigtuple, TransitionCaptureState *transition_capture, bool is_crosspart_update)
void ExecBSInsertTriggers(EState *estate, ResultRelInfo *relinfo)
bool ExecBRInsertTriggers(EState *estate, ResultRelInfo *relinfo, TupleTableSlot *slot)
bool ExecIRDeleteTriggers(EState *estate, ResultRelInfo *relinfo, HeapTuple trigtuple)
void ExecBSDeleteTriggers(EState *estate, ResultRelInfo *relinfo)
bool ExecIRInsertTriggers(EState *estate, ResultRelInfo *relinfo, TupleTableSlot *slot)
void ExecARUpdateTriggers(EState *estate, ResultRelInfo *relinfo, ResultRelInfo *src_partinfo, ResultRelInfo *dst_partinfo, ItemPointer tupleid, HeapTuple fdw_trigtuple, TupleTableSlot *newslot, List *recheckIndexes, TransitionCaptureState *transition_capture, bool is_crosspart_update)
bool ExecBRDeleteTriggers(EState *estate, EPQState *epqstate, ResultRelInfo *relinfo, ItemPointer tupleid, HeapTuple fdw_trigtuple, TupleTableSlot **epqslot, TM_Result *tmresult, TM_FailureData *tmfd, bool is_merge_delete)
void ExecASUpdateTriggers(EState *estate, ResultRelInfo *relinfo, TransitionCaptureState *transition_capture)
void ExecASDeleteTriggers(EState *estate, ResultRelInfo *relinfo, TransitionCaptureState *transition_capture)
void ExecARInsertTriggers(EState *estate, ResultRelInfo *relinfo, TupleTableSlot *slot, List *recheckIndexes, TransitionCaptureState *transition_capture)
void ExecASInsertTriggers(EState *estate, ResultRelInfo *relinfo, TransitionCaptureState *transition_capture)
bool ExecIRUpdateTriggers(EState *estate, ResultRelInfo *relinfo, HeapTuple trigtuple, TupleTableSlot *newslot)
void AfterTriggerEndQuery(EState *estate)
void ExecBSUpdateTriggers(EState *estate, ResultRelInfo *relinfo)
void AfterTriggerBeginQuery(void)
TupleTableSlot * execute_attr_map_slot(AttrMap *attrMap, TupleTableSlot *in_slot, TupleTableSlot *out_slot)
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
static CompactAttribute * TupleDescCompactAttr(TupleDesc tupdesc, int i)
static Datum slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
static void slot_getallattrs(TupleTableSlot *slot)
static TupleTableSlot * ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
static void ExecMaterializeSlot(TupleTableSlot *slot)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)
void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos)
bool TransactionIdIsCurrentTransactionId(TransactionId xid)
TransactionId GetCurrentTransactionId(void)
#define IsolationUsesXactSnapshot()