57 #define EXEC_FLAG_EXPLAIN_ONLY 0x0001
58 #define EXEC_FLAG_REWIND 0x0002
59 #define EXEC_FLAG_BACKWARD 0x0004
60 #define EXEC_FLAG_MARK 0x0008
61 #define EXEC_FLAG_SKIP_TRIGGERS 0x0010
62 #define EXEC_FLAG_WITH_OIDS 0x0020
63 #define EXEC_FLAG_WITHOUT_OIDS 0x0040
64 #define EXEC_FLAG_WITH_NO_DATA 0x0080
72 #define ExecEvalExpr(expr, econtext, isNull, isDone) \
73 ((*(expr)->evalfunc) (expr, econtext, isNull, isDone))
143 long nbuckets,
Size entrysize,
163 const char *attrName);
165 const char *attrName);
190 Index resultRelationIndex,
191 int instrument_options);
208 Plan *subplan,
List *auxrowmarks,
int epqParam);
215 #define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
295 #define do_text_output_oneline(tstate, str_to_emit) \
299 values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
300 isnull_[0] = false; \
301 do_tup_output(tstate, values_, isnull_); \
302 pfree(DatumGetPointer(values_[0])); \
316 #define ResetExprContext(econtext) \
317 MemoryContextReset((econtext)->ecxt_per_tuple_memory)
322 #define GetPerTupleExprContext(estate) \
323 ((estate)->es_per_tuple_exprcontext ? \
324 (estate)->es_per_tuple_exprcontext : \
325 MakePerTupleExprContext(estate))
327 #define GetPerTupleMemoryContext(estate) \
328 (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
331 #define ResetPerTupleExprContext(estate) \
333 if ((estate)->es_per_tuple_exprcontext) \
334 ResetExprContext((estate)->es_per_tuple_exprcontext); \
369 EState *estate,
bool noDupErr,
bool *specConflict,
370 List *arbiterIndexes);
377 EState *estate,
bool newIndex);
bool(* ExecutorCheckPerms_hook_type)(List *, bool)
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
TupleDesc ExecGetResultType(PlanState *planstate)
LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo)
TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions)
bool ExecCheckIndexConstraints(TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, List *arbiterIndexes)
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
bool ExecSupportsBackwardScan(Plan *node)
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid)
ExprContext * CreateExprContext(EState *estate)
bool execTuplesMatch(TupleTableSlot *slot1, TupleTableSlot *slot2, int numCols, AttrNumber *matchColIdx, FmgrInfo *eqfunctions, MemoryContext evalContext)
bool execTuplesUnequal(TupleTableSlot *slot1, TupleTableSlot *slot2, int numCols, AttrNumber *matchColIdx, FmgrInfo *eqfunctions, MemoryContext evalContext)
TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions, long nbuckets, Size entrysize, MemoryContext tablecxt, MemoryContext tempcxt)
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc)
TupleTableSlot * ExecProject(ProjectionInfo *projInfo, ExprDoneCond *isDone)
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
void ExecScanReScan(ScanState *node)
void ExecAssignScanTypeFromOuterPlan(ScanState *scanstate)
AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter, const char *attrName)
bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull)
void execTuplesHashPrepare(int numCols, Oid *eqOperators, FmgrInfo **eqFunctions, FmgrInfo **hashFunctions)
Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno, bool *isNull)
void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc)
void(* ExecutorEnd_hook_type)(QueryDesc *queryDesc)
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
void standard_ExecutorFinish(QueryDesc *queryDesc)
void ExecCloseIndices(ResultRelInfo *resultRelInfo)
FmgrInfo * execTuplesMatchPrepare(int numCols, Oid *eqOperators)
Node * MultiExecProcNode(PlanState *node)
void(* ExecutorFinish_hook_type)(QueryDesc *queryDesc)
int ExecCleanTargetListLength(List *targetlist)
TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid)
void ExecRestrPos(PlanState *node)
void ExecAssignScanProjectionInfo(ScanState *node)
JunkFilter * ExecInitJunkFilter(List *targetList, bool hasoid, TupleTableSlot *slot)
void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative)
Tuplestorestate * ExecMakeTableFunctionResult(ExprState *funcexpr, ExprContext *econtext, MemoryContext argContext, TupleDesc expectedDesc, bool randomAccess)
void ExecFreeExprContext(PlanState *planstate)
JunkFilter * ExecInitJunkFilterConversion(List *targetList, TupleDesc cleanTupType, TupleTableSlot *slot)
struct TupOutputState TupOutputState
void standard_ExecutorEnd(QueryDesc *queryDesc)
HeapTuple EvalPlanQualGetTuple(EPQState *epqstate, Index rti)
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
bool ExecShutdownNode(PlanState *node)
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
void(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
bool ExecContextForcesOids(PlanState *planstate, bool *hasoids)
bool ExecCheckRTPerms(List *rangeTable, bool ereport_on_violation)
void standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
bool ExecSupportsMarkRestore(struct Path *pathnode)
Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone)
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
TupleDesc ExecTypeFromExprList(List *exprList)
TupleTableSlot * ExecProcNode(PlanState *node)
void EvalPlanQualFetchRowMarks(EPQState *epqstate)
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate)
void InitResultRelInfo(ResultRelInfo *resultRelInfo, Relation resultRelationDesc, Index resultRelationIndex, int instrument_options)
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
void ExecutorRewind(QueryDesc *queryDesc)
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
bool ExecMaterializesOutput(NodeTag plantype)
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
void ExecAssignResultTypeFromTL(PlanState *planstate)
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid)
void EvalPlanQualBegin(EPQState *epqstate, EState *parentestate)
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
void end_tup_output(TupOutputState *tstate)
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
void ExecutorFinish(QueryDesc *queryDesc)
void CheckValidResultRel(Relation resultRel, CmdType operation)
ExprContext * CreateStandaloneExprContext(void)
void ExecReScan(PlanState *node)
AttrNumber ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
PGDLLIMPORT ExecutorFinish_hook_type ExecutorFinish_hook
HeapTuple EvalPlanQualFetch(EState *estate, Relation relation, int lockmode, LockWaitPolicy wait_policy, ItemPointer tid, TransactionId priorXmax)
PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
void FreeExprContext(ExprContext *econtext, bool isCommit)
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
void ExecEndNode(PlanState *node)
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
EState * CreateExecutorState(void)
void(* ExecutorRun_hook_type)(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
void ReScanExprContext(ExprContext *econtext)
void ExecCloseScanRelation(Relation scanrel)
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, TupleDesc inputDesc)
int ExecTargetListLength(List *targetlist)
Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
List * ExecInsertIndexTuples(TupleTableSlot *slot, ItemPointer tupleid, EState *estate, bool noDupErr, bool *specConflict, List *arbiterIndexes)
void RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
TupleDesc ExecTypeFromTL(List *targetList, bool hasoid)
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, Index varno)
void EvalPlanQualSetTuple(EPQState *epqstate, Index rti, HeapTuple tuple)
void ExecMarkPos(PlanState *node)
static Datum values[MAXATTR]
void EvalPlanQualInit(EPQState *epqstate, EState *estate, Plan *subplan, List *auxrowmarks, int epqParam)
void EvalPlanQualEnd(EPQState *epqstate)
void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull)
ExprContext * MakePerTupleExprContext(EState *estate)
TupleTableSlot * EvalPlanQual(EState *estate, EPQState *epqstate, Relation relation, Index rti, int lockmode, ItemPointer tid, TransactionId priorXmax)
Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
void ExecutorEnd(QueryDesc *queryDesc)
void check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo, ItemPointer tupleid, Datum *values, bool *isnull, EState *estate, bool newIndex)
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType)
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate)
void(* ExprContextCallbackFunction)(Datum arg)
void ExecInitResultTupleSlot(EState *estate, PlanState *planstate)
void do_text_output_multiline(TupOutputState *tstate, char *text)
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
void ExecutorStart(QueryDesc *queryDesc, int eflags)
void FreeExecutorState(EState *estate)