PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * executor.h
4  * support for the POSTGRES executor module
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/executor/executor.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef EXECUTOR_H
15 #define EXECUTOR_H
17 #include "catalog/partition.h"
18 #include "executor/execdesc.h"
19 #include "nodes/parsenodes.h"
22 /*
23  * The "eflags" argument to ExecutorStart and the various ExecInitNode
24  * routines is a bitwise OR of the following flag bits, which tell the
25  * called plan node what to expect. Note that the flags will get modified
26  * as they are passed down the plan tree, since an upper node may require
27  * functionality in its subnode not demanded of the plan as a whole
28  * (example: MergeJoin requires mark/restore capability in its inner input),
29  * or an upper node may shield its input from some functionality requirement
30  * (example: Materialize shields its input from needing to do backward scan).
31  *
32  * EXPLAIN_ONLY indicates that the plan tree is being initialized just so
33  * EXPLAIN can print it out; it will not be run. Hence, no side-effects
34  * of startup should occur. However, error checks (such as permission checks)
35  * should be performed.
36  *
37  * REWIND indicates that the plan node should try to efficiently support
38  * rescans without parameter changes. (Nodes must support ExecReScan calls
39  * in any case, but if this flag was not given, they are at liberty to do it
40  * through complete recalculation. Note that a parameter change forces a
41  * full recalculation in any case.)
42  *
43  * BACKWARD indicates that the plan node must respect the es_direction flag.
44  * When this is not passed, the plan node will only be run forwards.
45  *
46  * MARK indicates that the plan node must support Mark/Restore calls.
47  * When this is not passed, no Mark/Restore will occur.
48  *
49  * SKIP_TRIGGERS tells ExecutorStart/ExecutorFinish to skip calling
50  * AfterTriggerBeginQuery/AfterTriggerEndQuery. This does not necessarily
51  * mean that the plan can't queue any AFTER triggers; just that the caller
52  * is responsible for there being a trigger context for them to be queued in.
53  *
54  * WITH/WITHOUT_OIDS tell the executor to emit tuples with or without space
55  * for OIDs, respectively. These are currently used only for CREATE TABLE AS.
56  * If neither is set, the plan may or may not produce tuples including OIDs.
57  */
58 #define EXEC_FLAG_EXPLAIN_ONLY 0x0001 /* EXPLAIN, no ANALYZE */
59 #define EXEC_FLAG_REWIND 0x0002 /* need efficient rescan */
60 #define EXEC_FLAG_BACKWARD 0x0004 /* need backward scan */
61 #define EXEC_FLAG_MARK 0x0008 /* need mark/restore */
62 #define EXEC_FLAG_SKIP_TRIGGERS 0x0010 /* skip AfterTrigger calls */
63 #define EXEC_FLAG_WITH_OIDS 0x0020 /* force OIDs in returned tuples */
64 #define EXEC_FLAG_WITHOUT_OIDS 0x0040 /* force no OIDs in returned tuples */
65 #define EXEC_FLAG_WITH_NO_DATA 0x0080 /* rel scannability doesn't matter */
68 /*
69  * ExecEvalExpr was formerly a function containing a switch statement;
70  * now it's just a macro invoking the function pointed to by an ExprState
71  * node. Beware of double evaluation of the ExprState argument!
72  */
73 #define ExecEvalExpr(expr, econtext, isNull) \
74  ((*(expr)->evalfunc) (expr, econtext, isNull))
77 /* Hook for plugins to get control in ExecutorStart() */
78 typedef void (*ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags);
81 /* Hook for plugins to get control in ExecutorRun() */
82 typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc,
83  ScanDirection direction,
84  uint64 count,
85  bool execute_once);
88 /* Hook for plugins to get control in ExecutorFinish() */
89 typedef void (*ExecutorFinish_hook_type) (QueryDesc *queryDesc);
92 /* Hook for plugins to get control in ExecutorEnd() */
93 typedef void (*ExecutorEnd_hook_type) (QueryDesc *queryDesc);
96 /* Hook for plugins to get control in ExecCheckRTPerms() */
101 /*
102  * prototypes from functions in execAmi.c
103  */
104 struct Path; /* avoid including relation.h here */
106 extern void ExecReScan(PlanState *node);
107 extern void ExecMarkPos(PlanState *node);
108 extern void ExecRestrPos(PlanState *node);
109 extern bool ExecSupportsMarkRestore(struct Path *pathnode);
110 extern bool ExecSupportsBackwardScan(Plan *node);
111 extern bool ExecMaterializesOutput(NodeTag plantype);
113 /*
114  * prototypes from functions in execCurrent.c
115  */
116 extern bool execCurrentOf(CurrentOfExpr *cexpr,
117  ExprContext *econtext,
118  Oid table_oid,
119  ItemPointer current_tid);
121 /*
122  * prototypes from functions in execGrouping.c
123  */
124 extern bool execTuplesMatch(TupleTableSlot *slot1,
125  TupleTableSlot *slot2,
126  int numCols,
127  AttrNumber *matchColIdx,
128  FmgrInfo *eqfunctions,
129  MemoryContext evalContext);
130 extern bool execTuplesUnequal(TupleTableSlot *slot1,
131  TupleTableSlot *slot2,
132  int numCols,
133  AttrNumber *matchColIdx,
134  FmgrInfo *eqfunctions,
135  MemoryContext evalContext);
136 extern FmgrInfo *execTuplesMatchPrepare(int numCols,
137  Oid *eqOperators);
138 extern void execTuplesHashPrepare(int numCols,
139  Oid *eqOperators,
140  FmgrInfo **eqFunctions,
141  FmgrInfo **hashFunctions);
142 extern TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx,
143  FmgrInfo *eqfunctions,
144  FmgrInfo *hashfunctions,
145  long nbuckets, Size additionalsize,
146  MemoryContext tablecxt,
147  MemoryContext tempcxt, bool use_variable_hash_iv);
149  TupleTableSlot *slot,
150  bool *isnew);
152  TupleTableSlot *slot,
153  FmgrInfo *eqfunctions,
154  FmgrInfo *hashfunctions);
156 /*
157  * prototypes from functions in execJunk.c
158  */
159 extern JunkFilter *ExecInitJunkFilter(List *targetList, bool hasoid,
160  TupleTableSlot *slot);
161 extern JunkFilter *ExecInitJunkFilterConversion(List *targetList,
162  TupleDesc cleanTupType,
163  TupleTableSlot *slot);
164 extern AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter,
165  const char *attrName);
166 extern AttrNumber ExecFindJunkAttributeInTlist(List *targetlist,
167  const char *attrName);
169  bool *isNull);
170 extern TupleTableSlot *ExecFilterJunk(JunkFilter *junkfilter,
171  TupleTableSlot *slot);
174 /*
175  * prototypes from functions in execMain.c
176  */
177 extern void ExecutorStart(QueryDesc *queryDesc, int eflags);
178 extern void standard_ExecutorStart(QueryDesc *queryDesc, int eflags);
179 extern void ExecutorRun(QueryDesc *queryDesc,
180  ScanDirection direction, uint64 count, bool execute_once);
181 extern void standard_ExecutorRun(QueryDesc *queryDesc,
182  ScanDirection direction, uint64 count, bool execute_once);
183 extern void ExecutorFinish(QueryDesc *queryDesc);
184 extern void standard_ExecutorFinish(QueryDesc *queryDesc);
185 extern void ExecutorEnd(QueryDesc *queryDesc);
186 extern void standard_ExecutorEnd(QueryDesc *queryDesc);
187 extern void ExecutorRewind(QueryDesc *queryDesc);
188 extern bool ExecCheckRTPerms(List *rangeTable, bool ereport_on_violation);
189 extern void CheckValidResultRel(Relation resultRel, CmdType operation);
190 extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
191  Relation resultRelationDesc,
192  Index resultRelationIndex,
193  Relation partition_root,
194  int instrument_options);
195 extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid);
196 extern bool ExecContextForcesOids(PlanState *planstate, bool *hasoids);
197 extern void ExecConstraints(ResultRelInfo *resultRelInfo,
198  TupleTableSlot *slot, TupleTableSlot *orig_slot,
199  EState *estate);
200 extern void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo,
201  TupleTableSlot *slot, EState *estate);
202 extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
203 extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
204 extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
205 extern TupleTableSlot *EvalPlanQual(EState *estate, EPQState *epqstate,
206  Relation relation, Index rti, int lockmode,
207  ItemPointer tid, TransactionId priorXmax);
208 extern HeapTuple EvalPlanQualFetch(EState *estate, Relation relation,
209  int lockmode, LockWaitPolicy wait_policy, ItemPointer tid,
210  TransactionId priorXmax);
211 extern void EvalPlanQualInit(EPQState *epqstate, EState *estate,
212  Plan *subplan, List *auxrowmarks, int epqParam);
213 extern void EvalPlanQualSetPlan(EPQState *epqstate,
214  Plan *subplan, List *auxrowmarks);
215 extern void EvalPlanQualSetTuple(EPQState *epqstate, Index rti,
216  HeapTuple tuple);
217 extern HeapTuple EvalPlanQualGetTuple(EPQState *epqstate, Index rti);
219  PartitionDispatch **pd,
220  ResultRelInfo **partitions,
221  TupleConversionMap ***tup_conv_maps,
222  TupleTableSlot **partition_tuple_slot,
223  int *num_parted, int *num_partitions);
224 extern int ExecFindPartition(ResultRelInfo *resultRelInfo,
225  PartitionDispatch *pd,
226  TupleTableSlot *slot,
227  EState *estate);
229 #define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
230 extern void EvalPlanQualFetchRowMarks(EPQState *epqstate);
231 extern TupleTableSlot *EvalPlanQualNext(EPQState *epqstate);
232 extern void EvalPlanQualBegin(EPQState *epqstate, EState *parentestate);
233 extern void EvalPlanQualEnd(EPQState *epqstate);
235 /*
236  * prototypes from functions in execProcnode.c
237  */
238 extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags);
239 extern TupleTableSlot *ExecProcNode(PlanState *node);
240 extern Node *MultiExecProcNode(PlanState *node);
241 extern void ExecEndNode(PlanState *node);
242 extern bool ExecShutdownNode(PlanState *node);
244 /*
245  * prototypes from functions in execQual.c
246  */
248  bool *isNull);
249 extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
250  bool *isNull);
252  ExprContext *econtext,
253  MemoryContext argContext,
254  TupleDesc expectedDesc,
255  bool randomAccess);
257  ExprContext *econtext,
258  bool *isNull,
259  ExprDoneCond *isDone);
260 extern Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext,
261  bool *isNull);
262 extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
263 extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
264 extern bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull);
265 extern int ExecTargetListLength(List *targetlist);
266 extern int ExecCleanTargetListLength(List *targetlist);
267 extern TupleTableSlot *ExecProject(ProjectionInfo *projInfo);
269 /*
270  * prototypes from functions in execScan.c
271  */
272 typedef TupleTableSlot *(*ExecScanAccessMtd) (ScanState *node);
275 extern TupleTableSlot *ExecScan(ScanState *node, ExecScanAccessMtd accessMtd,
276  ExecScanRecheckMtd recheckMtd);
277 extern void ExecAssignScanProjectionInfo(ScanState *node);
278 extern void ExecAssignScanProjectionInfoWithVarno(ScanState *node, Index varno);
279 extern void ExecScanReScan(ScanState *node);
281 /*
282  * prototypes from functions in execTuples.c
283  */
284 extern void ExecInitResultTupleSlot(EState *estate, PlanState *planstate);
285 extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate);
288  TupleDesc tupType);
289 extern TupleDesc ExecTypeFromTL(List *targetList, bool hasoid);
290 extern TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid);
291 extern TupleDesc ExecTypeFromExprList(List *exprList);
292 extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList);
293 extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
295 typedef struct TupOutputState
296 {
302  TupleDesc tupdesc);
303 extern void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull);
304 extern void do_text_output_multiline(TupOutputState *tstate, const char *txt);
305 extern void end_tup_output(TupOutputState *tstate);
307 /*
308  * Write a single line of text given as a C string.
309  *
310  * Should only be used with a single-TEXT-attribute tupdesc.
311  */
312 #define do_text_output_oneline(tstate, str_to_emit) \
313  do { \
314  Datum values_[1]; \
315  bool isnull_[1]; \
316  values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
317  isnull_[0] = false; \
318  do_tup_output(tstate, values_, isnull_); \
319  pfree(DatumGetPointer(values_[0])); \
320  } while (0)
323 /*
324  * prototypes from functions in execUtils.c
325  */
326 extern EState *CreateExecutorState(void);
327 extern void FreeExecutorState(EState *estate);
328 extern ExprContext *CreateExprContext(EState *estate);
330 extern void FreeExprContext(ExprContext *econtext, bool isCommit);
331 extern void ReScanExprContext(ExprContext *econtext);
333 #define ResetExprContext(econtext) \
334  MemoryContextReset((econtext)->ecxt_per_tuple_memory)
338 /* Get an EState's per-output-tuple exprcontext, making it if first use */
339 #define GetPerTupleExprContext(estate) \
340  ((estate)->es_per_tuple_exprcontext ? \
341  (estate)->es_per_tuple_exprcontext : \
342  MakePerTupleExprContext(estate))
344 #define GetPerTupleMemoryContext(estate) \
345  (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
347 /* Reset an EState's per-output-tuple exprcontext, if one's been created */
348 #define ResetPerTupleExprContext(estate) \
349  do { \
350  if ((estate)->es_per_tuple_exprcontext) \
351  ResetExprContext((estate)->es_per_tuple_exprcontext); \
352  } while (0)
354 extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
355 extern void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc);
356 extern void ExecAssignResultTypeFromTL(PlanState *planstate);
357 extern TupleDesc ExecGetResultType(PlanState *planstate);
358 extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList,
359  ExprContext *econtext,
360  TupleTableSlot *slot,
361  TupleDesc inputDesc);
362 extern void ExecAssignProjectionInfo(PlanState *planstate,
363  TupleDesc inputDesc);
364 extern void ExecFreeExprContext(PlanState *planstate);
365 extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc);
366 extern void ExecAssignScanTypeFromOuterPlan(ScanState *scanstate);
368 extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
370 extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
371 extern void ExecCloseScanRelation(Relation scanrel);
373 extern void RegisterExprContextCallback(ExprContext *econtext,
375  Datum arg);
376 extern void UnregisterExprContextCallback(ExprContext *econtext,
378  Datum arg);
379 extern void ExecLockNonLeafAppendTables(List *partitioned_rels, EState *estate);
381 /*
382  * prototypes from functions in execIndexing.c
383  */
384 extern void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative);
385 extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
387  EState *estate, bool noDupErr, bool *specConflict,
388  List *arbiterIndexes);
389 extern bool ExecCheckIndexConstraints(TupleTableSlot *slot, EState *estate,
390  ItemPointer conflictTid, List *arbiterIndexes);
392  IndexInfo *indexInfo,
393  ItemPointer tupleid,
394  Datum *values, bool *isnull,
395  EState *estate, bool newIndex);
397 /*
398  * prototypes from functions in execReplication.c
399  */
400 extern bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid,
401  LockTupleMode lockmode,
402  TupleTableSlot *searchslot,
403  TupleTableSlot *outslot);
404 extern bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode,
405  TupleTableSlot *searchslot, TupleTableSlot *outslot);
407 extern void ExecSimpleRelationInsert(EState *estate, TupleTableSlot *slot);
408 extern void ExecSimpleRelationUpdate(EState *estate, EPQState *epqstate,
409  TupleTableSlot *searchslot, TupleTableSlot *slot);
410 extern void ExecSimpleRelationDelete(EState *estate, EPQState *epqstate,
411  TupleTableSlot *searchslot);
412 extern void CheckCmdReplicaIdentity(Relation rel, CmdType cmd);
415 #endif /* EXECUTOR_H */
bool(* ExecutorCheckPerms_hook_type)(List *, bool)
Definition: executor.h:97
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:747
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:773
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:460
LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo)
Definition: execMain.c:2221
TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions)
Definition: execGrouping.c:425
Definition: fmgr.h:53
bool ExecCheckIndexConstraints(TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, List *arbiterIndexes)
Definition: execIndexing.c:477
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1956
bool ExecSupportsBackwardScan(Plan *node)
Definition: execAmi.c:451
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid)
Definition: execMain.c:1350
ExprContext * CreateExprContext(EState *estate)
Definition: execUtils.c:209
bool execTuplesMatch(TupleTableSlot *slot1, TupleTableSlot *slot2, int numCols, AttrNumber *matchColIdx, FmgrInfo *eqfunctions, MemoryContext evalContext)
Definition: execGrouping.c:69
bool execTuplesUnequal(TupleTableSlot *slot1, TupleTableSlot *slot2, int numCols, AttrNumber *matchColIdx, FmgrInfo *eqfunctions, MemoryContext evalContext)
Definition: execGrouping.c:139
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc)
Definition: execTuples.c:1232
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
Definition: execMain.c:2247
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
Definition: execMain.c:2271
uint32 TransactionId
Definition: c.h:397
void ExecScanReScan(ScanState *node)
Definition: execScan.c:327
void ExecAssignScanTypeFromOuterPlan(ScanState *scanstate)
Definition: execUtils.c:722
AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter, const char *attrName)
Definition: execJunk.c:209
bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull)
Definition: execQual.c:5056
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:302
Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext, bool *isNull)
Definition: execQual.c:4220
void execTuplesHashPrepare(int numCols, Oid *eqOperators, FmgrInfo **eqFunctions, FmgrInfo **hashFunctions)
Definition: execGrouping.c:233
Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno, bool *isNull)
Definition: execQual.c:1162
void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc)
Definition: execUtils.c:419
void(* ExecutorEnd_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:93
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:898
void standard_ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:402
void ExecCloseIndices(ResultRelInfo *resultRelInfo)
Definition: execIndexing.c:224
FmgrInfo * execTuplesMatchPrepare(int numCols, Oid *eqOperators)
Definition: execGrouping.c:204
Node * MultiExecProcNode(PlanState *node)
Definition: execProcnode.c:591
void(* ExecutorFinish_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:89
Definition: nodes.h:522
int ExecCleanTargetListLength(List *targetlist)
Definition: execQual.c:5133
TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid)
Definition: execTuples.c:900
void ExecRestrPos(PlanState *node)
Definition: execAmi.c:353
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:235
void ExecSimpleRelationDelete(EState *estate, EPQState *epqstate, TupleTableSlot *searchslot)
TupleTableSlot * slot
Definition: executor.h:297
bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid, LockTupleMode lockmode, TupleTableSlot *searchslot, TupleTableSlot *outslot)
JunkFilter * ExecInitJunkFilter(List *targetList, bool hasoid, TupleTableSlot *slot)
Definition: execJunk.c:61
void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative)
Definition: execIndexing.c:149
Tuplestorestate * ExecMakeTableFunctionResult(ExprState *funcexpr, ExprContext *econtext, MemoryContext argContext, TupleDesc expectedDesc, bool randomAccess)
Definition: execQual.c:1882
unsigned int Oid
Definition: postgres_ext.h:31
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:686
Definition: nodes.h:26
JunkFilter * ExecInitJunkFilterConversion(List *targetList, TupleDesc cleanTupType, TupleTableSlot *slot)
Definition: execJunk.c:136
struct TupOutputState TupOutputState
void standard_ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:462
HeapTuple EvalPlanQualGetTuple(EPQState *epqstate, Index rti)
Definition: execMain.c:2713
Definition: c.h:1063
char bool
Definition: c.h:202
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
Definition: execTuples.c:986
bool ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:841
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Definition: executor.h:272
Definition: type.h:90
void(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
Definition: executor.h:78
bool ExecContextForcesOids(PlanState *planstate, bool *hasoids)
Definition: execMain.c:1440
bool ExecCheckRTPerms(List *rangeTable, bool ereport_on_violation)
Definition: execMain.c:562
void standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:153
Definition: heapam.h:38
bool ExecSupportsMarkRestore(struct Path *pathnode)
Definition: execAmi.c:395
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
Definition: executor.h:273
TupleDesc ExecTypeFromExprList(List *exprList)
Definition: execTuples.c:947
TupleTableSlot * ExecProcNode(PlanState *node)
Definition: execProcnode.c:392
void EvalPlanQualFetchRowMarks(EPQState *epqstate)
Definition: execMain.c:2728
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
Definition: execMain.c:2677
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate)
Definition: execTuples.c:842
void ExecutorRewind(QueryDesc *queryDesc)
Definition: execMain.c:519
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
Definition: execMain.c:72
bool ExecMaterializesOutput(NodeTag plantype)
Definition: execAmi.c:566
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
Definition: execScan.c:121
RelOptInfo * parent
Definition: relation.h:917
TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
Definition: execQual.c:5215
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:710
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
Definition: execMain.c:69
void ExecAssignResultTypeFromTL(PlanState *planstate)
Definition: execUtils.c:431
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
Definition: execUtils.c:841
bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid)
Definition: execCurrent.c:41
void EvalPlanQualBegin(EPQState *epqstate, EState *parentestate)
Definition: execMain.c:2879
Definition: sdir.h:22
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:658
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
Definition: execMain.c:2863
void end_tup_output(TupOutputState *tstate)
Definition: execTuples.c:1308
Definition: parsenodes.h:1062
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew)
Definition: execGrouping.c:351
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:409
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:393
void CheckValidResultRel(Relation resultRel, CmdType operation)
Definition: execMain.c:1055
ExprContext * CreateStandaloneExprContext(void)
Definition: execUtils.c:281
Definition: execnodes.h:168
void ExecSimpleRelationInsert(EState *estate, TupleTableSlot *slot)
void ExecReScan(PlanState *node)
Definition: execAmi.c:74
AttrNumber ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
Definition: execJunk.c:221
PGDLLIMPORT ExecutorFinish_hook_type ExecutorFinish_hook
Definition: execMain.c:71
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, TupleTableSlot *orig_slot, EState *estate)
Definition: execMain.c:1828
HeapTuple EvalPlanQualFetch(EState *estate, Relation relation, int lockmode, LockWaitPolicy wait_policy, ItemPointer tid, TransactionId priorXmax)
Definition: execMain.c:2429
PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
Definition: execMain.c:75
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
Definition: execQual.c:4267
uintptr_t Datum
Definition: postgres.h:372
void ExecSetupPartitionTupleRouting(Relation rel, PartitionDispatch **pd, ResultRelInfo **partitions, TupleConversionMap ***tup_conv_maps, TupleTableSlot **partition_tuple_slot, int *num_parted, int *num_partitions)
Definition: execMain.c:3138
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:340
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
Definition: execJunk.c:262
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:644
unsigned int Index
Definition: c.h:365
void InitResultRelInfo(ResultRelInfo *resultRelInfo, Relation resultRelationDesc, Index resultRelationIndex, Relation partition_root, int instrument_options)
Definition: execMain.c:1255
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
Definition: execQual.c:5005
EState * CreateExecutorState(void)
Definition: execUtils.c:73
void ReScanExprContext(ExprContext *econtext)
Definition: execUtils.c:367
void ExecCloseScanRelation(Relation scanrel)
Definition: execUtils.c:831
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, TupleDesc inputDesc)
Definition: execUtils.c:483
int ExecTargetListLength(List *targetlist)
Definition: execQual.c:5123
Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
Definition: execJunk.c:248
List * ExecInsertIndexTuples(TupleTableSlot *slot, ItemPointer tupleid, EState *estate, bool noDupErr, bool *specConflict, List *arbiterIndexes)
Definition: execIndexing.c:271
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:291
void RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:872
TupleDesc ExecTypeFromTL(List *targetList, bool hasoid)
Definition: execTuples.c:888
int ExecFindPartition(ResultRelInfo *resultRelInfo, PartitionDispatch *pd, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:3227
Datum ExecMakeFunctionResultSet(FuncExprState *fcache, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone)
Definition: execQual.c:1615
size_t Size
Definition: c.h:356
void CheckCmdReplicaIdentity(Relation rel, CmdType cmd)
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, Index varno)
Definition: execScan.c:247
void EvalPlanQualSetTuple(EPQState *epqstate, Index rti, HeapTuple tuple)
Definition: execMain.c:2693
void ExecMarkPos(PlanState *node)
Definition: execAmi.c:304
void do_text_output_multiline(TupOutputState *tstate, const char *txt)
Definition: execTuples.c:1278
static Datum values[MAXATTR]
Definition: bootstrap.c:162
void EvalPlanQualInit(EPQState *epqstate, EState *estate, Plan *subplan, List *auxrowmarks, int epqParam)
Definition: execMain.c:2658
void EvalPlanQualEnd(EPQState *epqstate)
Definition: execMain.c:3069
bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode, TupleTableSlot *searchslot, TupleTableSlot *outslot)
void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull)
Definition: execTuples.c:1250
ExprContext * MakePerTupleExprContext(EState *estate)
Definition: execUtils.c:382
TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions, long nbuckets, Size additionalsize, MemoryContext tablecxt, MemoryContext tempcxt, bool use_variable_hash_iv)
Definition: execGrouping.c:290
TupleTableSlot * EvalPlanQual(EState *estate, EPQState *epqstate, Relation relation, Index rti, int lockmode, ItemPointer tid, TransactionId priorXmax)
Definition: execMain.c:2342
Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull)
Definition: execQual.c:1210
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:139
void ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:453
void check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo, ItemPointer tupleid, Datum *values, bool *isnull, EState *estate, bool newIndex)
Definition: execIndexing.c:867
void ExecLockNonLeafAppendTables(List *partitioned_rels, EState *estate)
Definition: execUtils.c:966
void * arg
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType)
Definition: execTuples.c:866
DestReceiver * dest
Definition: executor.h:298
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate)
Definition: execTuples.c:852
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:93
void ExecInitResultTupleSlot(EState *estate, PlanState *planstate)
Definition: execTuples.c:832
void(* ExecutorRun_hook_type)(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: executor.h:82
Definition: pg_list.h:45
void ExecSimpleRelationUpdate(EState *estate, EPQState *epqstate, TupleTableSlot *searchslot, TupleTableSlot *slot)
int16 AttrNumber
Definition: attnum.h:21
Definition: lockoptions.h:36
Definition: nodes.h:655
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
Definition: execMain.c:70
Definition: relation.h:911
void ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:144
void FreeExecutorState(EState *estate)
Definition: execUtils.c:169