1/*-------------------------------------------------------------------------
4 * support for the POSTGRES executor module
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/executor/executor.h
12 *-------------------------------------------------------------------------
26 * The "eflags" argument to ExecutorStart and the various ExecInitNode
27 * routines is a bitwise OR of the following flag bits, which tell the
28 * called plan node what to expect. Note that the flags will get modified
29 * as they are passed down the plan tree, since an upper node may require
30 * functionality in its subnode not demanded of the plan as a whole
31 * (example: MergeJoin requires mark/restore capability in its inner input),
32 * or an upper node may shield its input from some functionality requirement
33 * (example: Materialize shields its input from needing to do backward scan).
35 * EXPLAIN_ONLY indicates that the plan tree is being initialized just so
36 * EXPLAIN can print it out; it will not be run. Hence, no side-effects
37 * of startup should occur. However, error checks (such as permission checks)
38 * should be performed.
40 * EXPLAIN_GENERIC can only be used together with EXPLAIN_ONLY. It indicates
41 * that a generic plan is being shown using EXPLAIN (GENERIC_PLAN), which
42 * means that missing parameter values must be tolerated. Currently, the only
43 * effect is to suppress execution-time partition pruning.
45 * REWIND indicates that the plan node should try to efficiently support
46 * rescans without parameter changes. (Nodes must support ExecReScan calls
47 * in any case, but if this flag was not given, they are at liberty to do it
48 * through complete recalculation. Note that a parameter change forces a
49 * full recalculation in any case.)
51 * BACKWARD indicates that the plan node must respect the es_direction flag.
52 * When this is not passed, the plan node will only be run forwards.
54 * MARK indicates that the plan node must support Mark/Restore calls.
55 * When this is not passed, no Mark/Restore will occur.
57 * SKIP_TRIGGERS tells ExecutorStart/ExecutorFinish to skip calling
58 * AfterTriggerBeginQuery/AfterTriggerEndQuery. This does not necessarily
59 * mean that the plan can't queue any AFTER triggers; just that the caller
60 * is responsible for there being a trigger context for them to be queued in.
62 * WITH_NO_DATA indicates that we are performing REFRESH MATERIALIZED VIEW
63 * ... WITH NO DATA. Currently, the only effect is to suppress errors about
64 * scanning unpopulated materialized views.
66 #define EXEC_FLAG_EXPLAIN_ONLY 0x0001 /* EXPLAIN, no ANALYZE */
67 #define EXEC_FLAG_EXPLAIN_GENERIC 0x0002 /* EXPLAIN (GENERIC_PLAN) */
68 #define EXEC_FLAG_REWIND 0x0004 /* need efficient rescan */
69 #define EXEC_FLAG_BACKWARD 0x0008 /* need backward scan */
70 #define EXEC_FLAG_MARK 0x0010 /* need mark/restore */
71 #define EXEC_FLAG_SKIP_TRIGGERS 0x0020 /* skip AfterTrigger setup */
72 #define EXEC_FLAG_WITH_NO_DATA 0x0040 /* REFRESH ... WITH NO DATA */
75/* Hook for plugins to get control in ExecutorStart() */
79/* Hook for plugins to get control in ExecutorRun() */
85/* Hook for plugins to get control in ExecutorFinish() */
89/* Hook for plugins to get control in ExecutorEnd() */
93/* Hook for plugins to get control in ExecCheckPermissions() */
96 bool ereport_on_violation);
101 * prototypes from functions in execAmi.c
103 typedef struct Path Path;
/* avoid including pathnodes.h here */
113 * prototypes from functions in execCurrent.c
121 * prototypes from functions in execGrouping.c
126 const Oid *eqOperators,
127 const Oid *collations,
130 const Oid *eqOperators,
138 const Oid *eqfuncoids,
146 bool use_variable_hash_iv);
163 * Return size of the hash bucket. Useful for estimating memory usage.
172 * Return tuple from hash entry.
181 * Get a pointer into the additional space allocated for this entry. The
182 * memory will be maxaligned and zeroed.
184 * The amount of space available is the additionalsize requested in the call
185 * to BuildTupleHashTable(). If additionalsize was specified as zero, return
199 * prototypes from functions in execJunk.c
207 const char *attrName);
209 const char *attrName);
214 * ExecGetJunkAttribute
216 * Given a junk filter's input tuple (slot) and a junk attribute's number
217 * previously found by ExecFindJunkAttribute, extract & return the value and
218 * isNull flag of the attribute.
230 * prototypes from functions in execMain.c
244 List *rteperminfos,
bool ereport_on_violation);
251 Index resultRelationIndex,
253 int instrument_options);
262 List *notnull_virtual_attrs);
280 int epqParam,
List *resultRelations);
286 #define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
293 * functions in execProcnode.c
303/* ----------------------------------------------------------------
306 * Execute the given node to return a(nother) tuple.
307 * ----------------------------------------------------------------
313 if (node->
chgParam != NULL)
/* something changed? */
314 ExecReScan(node);
/* let ReScan handle this */
321 * prototypes from functions in execExpr.c
329 bool doSort,
bool doHash,
bool nullcheck);
340 const Oid *hashfunc_oids,
341 const List *collations,
342 const List *hash_exprs,
344 uint32 init_value,
bool keep_nulls);
349 const Oid *eqfunctions,
350 const Oid *collations,
355 const Oid *eqfunctions,
356 const Oid *collations,
357 const List *param_exprs,
379 * Evaluate expression identified by "state" in the execution context
380 * given by "econtext". *isNull is set to the is-null flag for the result,
381 * and the Datum value is the function result.
383 * The caller should already have switched into the temporary memory
384 * context econtext->ecxt_per_tuple_memory. The convenience entry point
385 * ExecEvalExprSwitchContext() is provided for callers who don't prefer to
386 * do the switch in an outer loop.
394 return state->evalfunc(
state, econtext, isNull);
399 * ExecEvalExprNoReturn
401 * Like ExecEvalExpr(), but for cases where no return value is expected,
402 * because the side-effects of expression evaluation are what's desired. This
403 * is e.g. used for projection and aggregate transition computation.
405 * Evaluate expression identified by "state" in the execution context
406 * given by "econtext".
408 * The caller should already have switched into the temporary memory context
409 * econtext->ecxt_per_tuple_memory. The convenience entry point
410 * ExecEvalExprNoReturnSwitchContext() is provided for callers who don't
411 * prefer to do the switch in an outer loop.
420 retDatum =
state->evalfunc(
state, econtext, NULL);
427 * ExecEvalExprSwitchContext
429 * Same as ExecEvalExpr, but get into the right allocation context explicitly.
441 retDatum =
state->evalfunc(
state, econtext, isNull);
448 * ExecEvalExprNoReturnSwitchContext
450 * Same as ExecEvalExprNoReturn, but get into the right allocation context
469 * Projects a tuple based on projection info and stores it in the slot passed
470 * to ExecBuildProjectionInfo().
472 * Note: the result is always a virtual tuple; therefore it may reference
473 * the contents of the exprContext's scan tuples and/or temporary results
474 * constructed in the exprContext. If the caller wishes the result to be
475 * valid longer than that data will be valid, he must call ExecMaterializeSlot
476 * on the result slot.
487 * Clear any former contents of the result slot. This makes it safe for
488 * us to use the slot's Datum/isnull arrays as workspace.
492 /* Run the expression */
496 * Successfully formed a result row. Mark the result slot as containing a
497 * valid virtual tuple (inlined version of ExecStoreVirtualTuple()).
507 * ExecQual - evaluate a qual prepared with ExecInitQual (possibly via
508 * ExecPrepareQual). Returns true if qual is satisfied, else false.
510 * Note: ExecQual used to have a third argument "resultForNull". The
511 * behavior of this function now corresponds to resultForNull == false.
512 * If you want the resultForNull == true behavior, see ExecCheck.
521 /* short-circuit (here and in ExecInitQual) for empty restriction list */
525 /* verify that expression was compiled using ExecInitQual */
530 /* EEOP_QUAL should never return NULL */
538 * ExecQualAndReset() - evaluate qual with ExecQual() and reset expression
547 /* inline ResetExprContext, to avoid ordering issue in this file */
556 * prototypes from functions in execSRF.c
574 * prototypes from functions in execScan.c
586 * prototypes from functions in execTuples.c
621 * Write a single line of text given as a C string.
623 * Should only be used with a single-TEXT-attribute tupdesc.
625 #define do_text_output_oneline(tstate, str_to_emit) \
629 values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
630 isnull_[0] = false; \
631 do_tup_output(tstate, values_, isnull_); \
632 pfree(DatumGetPointer(values_[0])); \
637 * prototypes from functions in execUtils.c
647 #define ResetExprContext(econtext) \
648 MemoryContextReset((econtext)->ecxt_per_tuple_memory)
652/* Get an EState's per-output-tuple exprcontext, making it if first use */
653 #define GetPerTupleExprContext(estate) \
654 ((estate)->es_per_tuple_exprcontext ? \
655 (estate)->es_per_tuple_exprcontext : \
656 MakePerTupleExprContext(estate))
658 #define GetPerTupleMemoryContext(estate) \
659 (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
661/* Reset an EState's per-output-tuple exprcontext, if one's been created */
662 #define ResetPerTupleExprContext(estate) \
664 if ((estate)->es_per_tuple_exprcontext) \
665 ResetExprContext((estate)->es_per_tuple_exprcontext); \
735 * prototypes from functions in execIndexing.c
743 bool *specConflict,
List *arbiterIndexes,
744 bool onlySummarizing);
749 List *arbiterIndexes);
754 EState *estate,
bool newIndex);
757 * prototypes from functions in execReplication.c
791 * prototypes from functions in nodeModifyTable.c
801#endif /* EXECUTOR_H */
static Datum values[MAXATTR]
#define PG_USED_FOR_ASSERTS_ONLY
struct TupleHashEntryData TupleHashEntryData
TupleTableSlot *(* ExecProcNodeMtd)(PlanState *pstate)
static MinimalTuple TupleHashEntryGetTuple(TupleHashEntry entry)
TupleDesc ExecGetResultType(PlanState *planstate)
Relation ExecGetRangeTableRelation(EState *estate, Index rti, bool isResultRel)
bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode, TupleTableSlot *searchslot, TupleTableSlot *outslot)
bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid, LockTupleMode lockmode, TupleTableSlot *searchslot, TupleTableSlot *outslot)
LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo)
ResultRelInfo * ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid, bool missing_ok, bool update_cache)
ExprState * execTuplesMatchPrepare(TupleDesc desc, int numCols, const AttrNumber *keyColIdx, const Oid *eqOperators, const Oid *collations, PlanState *parent)
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
TupleConversionMap * ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate)
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid, ResultRelInfo *rootRelInfo)
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno)
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
TupleTableSlot * EvalPlanQualSlot(EPQState *epqstate, Relation relation, Index rti)
Bitmapset * ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate)
void ExecSimpleRelationDelete(ResultRelInfo *resultRelInfo, EState *estate, EPQState *epqstate, TupleTableSlot *searchslot)
void CheckSubscriptionRelkind(char relkind, const char *nspname, const char *relname)
void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation, OnConflictAction onConflictAction, List *mergeActions)
void EvalPlanQualBegin(EPQState *epqstate)
Bitmapset * ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate)
TupleTableSlot * ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo)
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
char * ExecBuildSlotValueDescription(Oid reloid, TupleTableSlot *slot, TupleDesc tupdesc, Bitmapset *modifiedCols, int maxfieldlen)
ExprState * ExecBuildHash32FromAttrs(TupleDesc desc, const TupleTableSlotOps *ops, FmgrInfo *hashfunctions, Oid *collations, int numCols, AttrNumber *keyColIdx, PlanState *parent, uint32 init_value)
void ReScanExprContext(ExprContext *econtext)
static TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
bool ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool emitError)
static void * TupleHashEntryGetAdditional(TupleHashTable hashtable, TupleHashEntry entry)
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
JunkFilter * ExecInitJunkFilterConversion(List *targetList, TupleDesc cleanTupType, TupleTableSlot *slot)
void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull)
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
bool ExecCheck(ExprState *state, ExprContext *econtext)
ExprContext * CreateExprContext(EState *estate)
ExprState * ExecInitCheck(List *qual, PlanState *parent)
SetExprState * ExecInitFunctionResultSet(Expr *expr, ExprContext *econtext, PlanState *parent)
bool RelationFindDeletedTupleInfoSeq(Relation rel, TupleTableSlot *searchslot, TransactionId oldestxmin, TransactionId *delete_xid, RepOriginId *delete_origin, TimestampTz *delete_time)
void execTuplesHashPrepare(int numCols, const Oid *eqOperators, Oid **eqFuncOids, FmgrInfo **hashFunctions)
void(* ExecutorFinish_hook_type)(QueryDesc *queryDesc)
TupleConversionMap * ExecGetChildToRootMap(ResultRelInfo *resultRelInfo)
ExprContext * CreateStandaloneExprContext(void)
void ExecutorEnd(QueryDesc *queryDesc)
void EvalPlanQualInit(EPQState *epqstate, EState *parentestate, Plan *subplan, List *auxrowmarks, int epqParam, List *resultRelations)
TupleTableSlot * ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo)
TupleDesc ExecCleanTypeFromTL(List *targetList)
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
int executor_errposition(EState *estate, int location)
void ExecInitResultSlot(PlanState *planstate, const TupleTableSlotOps *tts_ops)
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent, TupleDesc inputDesc)
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
TupleHashEntry LookupTupleHashEntryHash(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 hash)
static RangeTblEntry * exec_rt_fetch(Index rti, EState *estate)
Tuplestorestate * ExecMakeTableFunctionResult(SetExprState *setexpr, ExprContext *econtext, MemoryContext argContext, TupleDesc expectedDesc, bool randomAccess)
Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno, bool *isNull)
void FreeExprContext(ExprContext *econtext, bool isCommit)
void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos, Bitmapset *unpruned_relids)
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
Node * MultiExecProcNode(PlanState *node)
AttrNumber ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
Bitmapset * ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate)
TupleTableSlot * ExecGetUpdateNewTuple(ResultRelInfo *relinfo, TupleTableSlot *planSlot, TupleTableSlot *oldSlot)
const TupleTableSlotOps * ExecGetCommonSlotOps(PlanState **planstates, int nplans)
void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo, Index rti)
void end_tup_output(TupOutputState *tstate)
void InitResultRelInfo(ResultRelInfo *resultRelInfo, Relation resultRelationDesc, Index resultRelationIndex, ResultRelInfo *partition_root_rri, int instrument_options)
void ExecMarkPos(PlanState *node)
void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node)
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
Datum ExecMakeFunctionResultSet(SetExprState *fcache, ExprContext *econtext, MemoryContext argContext, bool *isNull, ExprDoneCond *isDone)
void standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
void ExecCreateScanSlotFromOuterPlan(EState *estate, ScanState *scanstate, const TupleTableSlotOps *tts_ops)
void ExecutorFinish(QueryDesc *queryDesc)
bool ExecSupportsMarkRestore(Path *pathnode)
void ExecEndNode(PlanState *node)
JunkFilter * ExecInitJunkFilter(List *targetList, TupleTableSlot *slot)
void ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo, EState *estate, EPQState *epqstate, TupleTableSlot *searchslot, TupleTableSlot *slot)
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 *hash)
void EvalPlanQualEnd(EPQState *epqstate)
void ExecInitResultTypeTL(PlanState *planstate)
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
void CheckCmdReplicaIdentity(Relation rel, CmdType cmd)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
ExprState * ExecBuildAggTrans(AggState *aggstate, struct AggStatePerPhaseData *phase, bool doSort, bool doHash, bool nullcheck)
void(* ExecutorRun_hook_type)(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
void ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo, EState *estate, TupleTableSlot *slot)
AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter, const char *attrName)
PGDLLIMPORT ExecutorFinish_hook_type ExecutorFinish_hook
void ExecutorRewind(QueryDesc *queryDesc)
void do_text_output_multiline(TupOutputState *tstate, const char *txt)
void ExecShutdownNode(PlanState *node)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
void ExecutorStart(QueryDesc *queryDesc, int eflags)
ExprState * ExecPrepareQual(List *qual, EState *estate)
AttrNumber ExecRelGenVirtualNotNull(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, List *notnull_virtual_attrs)
SetExprState * ExecInitTableFunctionResult(Expr *expr, ExprContext *econtext, PlanState *parent)
ExprState * ExecInitQual(List *qual, PlanState *parent)
TupleTableSlot * EvalPlanQual(EPQState *epqstate, Relation relation, Index rti, TupleTableSlot *inputslot)
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
void(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
static bool ExecQual(ExprState *state, ExprContext *econtext)
ExprContext * MakePerTupleExprContext(EState *estate)
bool ExecCheckOneRelPerms(RTEPermissionInfo *perminfo)
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
const TupleTableSlotOps * ExecGetCommonChildSlotOps(PlanState *ps)
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
bool(* ExecutorCheckPerms_hook_type)(List *rangeTable, List *rtePermInfos, bool ereport_on_violation)
uint32 TupleHashTableHash(TupleHashTable hashtable, TupleTableSlot *slot)
bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
List * ExecInitExprList(List *nodes, PlanState *parent)
void ExecConditionalAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc, int varno)
bool RelationFindDeletedTupleInfoByIndex(Relation rel, Oid idxoid, TupleTableSlot *searchslot, TransactionId oldestxmin, TransactionId *delete_xid, RepOriginId *delete_origin, TimestampTz *delete_time)
void(* ExecutorEnd_hook_type)(QueryDesc *queryDesc)
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
void ExecCloseIndices(ResultRelInfo *resultRelInfo)
void RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
ExprState * ExecInitExprWithParams(Expr *node, ParamListInfo ext_params)
void ExecAssignScanProjectionInfo(ScanState *node)
int ExecTargetListLength(List *targetlist)
ProjectionInfo * ExecBuildUpdateProjection(List *targetList, bool evalTargetList, List *targetColnos, TupleDesc relDesc, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent)
void FreeExecutorState(EState *estate)
struct TupOutputState TupOutputState
static size_t TupleHashEntrySize(void)
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
ExprState * ExecBuildGroupingEqual(TupleDesc ldesc, TupleDesc rdesc, const TupleTableSlotOps *lops, const TupleTableSlotOps *rops, int numCols, const AttrNumber *keyColIdx, const Oid *eqfunctions, const Oid *collations, PlanState *parent)
TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, ExprState *eqcomp, ExprState *hashexpr)
void ExecCloseResultRelations(EState *estate)
static TupleTableSlot * ExecProcNode(PlanState *node)
TupleTableSlot * ExecGetAllNullSlot(EState *estate, ResultRelInfo *relInfo)
bool ExecMaterializesOutput(NodeTag plantype)
void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative)
int ExecCleanTargetListLength(List *targetlist)
ExprContext * CreateWorkExprContext(EState *estate)
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
void ExecScanReScan(ScanState *node)
bool ExecSupportsBackwardScan(Plan *node)
const TupleTableSlotOps * ExecGetResultSlotOps(PlanState *planstate, bool *isfixed)
Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull)
TupleHashTable BuildTupleHashTable(PlanState *parent, TupleDesc inputDesc, const TupleTableSlotOps *inputOps, int numCols, AttrNumber *keyColIdx, const Oid *eqfuncoids, FmgrInfo *hashfunctions, Oid *collations, long nbuckets, Size additionalsize, MemoryContext metacxt, MemoryContext tablecxt, MemoryContext tempcxt, bool use_variable_hash_iv)
PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, ItemPointer tupleid, List *arbiterIndexes)
Bitmapset * ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate)
void ExecReScan(PlanState *node)
static void ExecEvalExprNoReturn(ExprState *state, ExprContext *econtext)
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
TupleDesc ExecTypeFromExprList(List *exprList)
List * ExecInsertIndexTuples(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool update, bool noDupErr, bool *specConflict, List *arbiterIndexes, bool onlySummarizing)
TupleDesc ExecTypeFromTL(List *targetList)
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid)
void ResetTupleHashTable(TupleHashTable hashtable)
List * ExecPrepareExprList(List *nodes, EState *estate)
void standard_ExecutorEnd(QueryDesc *queryDesc)
void ExecRestrPos(PlanState *node)
static void ExecEvalExprNoReturnSwitchContext(ExprState *state, ExprContext *econtext)
void ExecCloseRangeTableRelations(EState *estate)
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
void check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo, ItemPointer tupleid, const Datum *values, const bool *isnull, EState *estate, bool newIndex)
void ExecSetExecProcNode(PlanState *node, ExecProcNodeMtd function)
void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
ExprState * ExecBuildParamSetEqual(TupleDesc desc, const TupleTableSlotOps *lops, const TupleTableSlotOps *rops, const Oid *eqfunctions, const Oid *collations, const List *param_exprs, PlanState *parent)
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType, const TupleTableSlotOps *tts_ops)
TupleTableSlot * ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo)
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
bool ExecCheckPermissions(List *rangeTable, List *rteperminfos, bool ereport_on_violation)
static Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate)
ExprState * ExecBuildHash32Expr(TupleDesc desc, const TupleTableSlotOps *ops, const Oid *hashfunc_oids, const List *collations, const List *hash_exprs, const bool *opstrict, PlanState *parent, uint32 init_value, bool keep_nulls)
EState * CreateExecutorState(void)
ExprState * ExecPrepareCheck(List *qual, EState *estate)
List * ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo)
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
void standard_ExecutorFinish(QueryDesc *queryDesc)
void(* ExprContextCallbackFunction)(Datum arg)
Assert(PointerIsAligned(start, uint64))
void MemoryContextReset(MemoryContext context)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
on_exit_nicely_callback function
static void * list_nth(const List *list, int n)
static bool DatumGetBool(Datum X)
static unsigned hash(unsigned *uv, int n)
MemoryContext ecxt_per_tuple_memory
ExecProcNodeMtd ExecProcNode
ExprContext * pi_exprContext
TupleDesc tts_tupleDescriptor
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)