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);
87 /* Hook for plugins to get control in ExecutorFinish() */
88 typedef void (*ExecutorFinish_hook_type) (QueryDesc *queryDesc);
91 /* Hook for plugins to get control in ExecutorEnd() */
92 typedef void (*ExecutorEnd_hook_type) (QueryDesc *queryDesc);
95 /* Hook for plugins to get control in ExecCheckRTPerms() */
100 /*
101  * prototypes from functions in execAmi.c
102  */
103 struct Path; /* avoid including relation.h here */
105 extern void ExecReScan(PlanState *node);
106 extern void ExecMarkPos(PlanState *node);
107 extern void ExecRestrPos(PlanState *node);
108 extern bool ExecSupportsMarkRestore(struct Path *pathnode);
109 extern bool ExecSupportsBackwardScan(Plan *node);
110 extern bool ExecMaterializesOutput(NodeTag plantype);
112 /*
113  * prototypes from functions in execCurrent.c
114  */
115 extern bool execCurrentOf(CurrentOfExpr *cexpr,
116  ExprContext *econtext,
117  Oid table_oid,
118  ItemPointer current_tid);
120 /*
121  * prototypes from functions in execGrouping.c
122  */
123 extern bool execTuplesMatch(TupleTableSlot *slot1,
124  TupleTableSlot *slot2,
125  int numCols,
126  AttrNumber *matchColIdx,
127  FmgrInfo *eqfunctions,
128  MemoryContext evalContext);
129 extern bool execTuplesUnequal(TupleTableSlot *slot1,
130  TupleTableSlot *slot2,
131  int numCols,
132  AttrNumber *matchColIdx,
133  FmgrInfo *eqfunctions,
134  MemoryContext evalContext);
135 extern FmgrInfo *execTuplesMatchPrepare(int numCols,
136  Oid *eqOperators);
137 extern void execTuplesHashPrepare(int numCols,
138  Oid *eqOperators,
139  FmgrInfo **eqFunctions,
140  FmgrInfo **hashFunctions);
141 extern TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx,
142  FmgrInfo *eqfunctions,
143  FmgrInfo *hashfunctions,
144  long nbuckets, Size additionalsize,
145  MemoryContext tablecxt,
146  MemoryContext tempcxt, bool use_variable_hash_iv);
148  TupleTableSlot *slot,
149  bool *isnew);
151  TupleTableSlot *slot,
152  FmgrInfo *eqfunctions,
153  FmgrInfo *hashfunctions);
155 /*
156  * prototypes from functions in execJunk.c
157  */
158 extern JunkFilter *ExecInitJunkFilter(List *targetList, bool hasoid,
159  TupleTableSlot *slot);
160 extern JunkFilter *ExecInitJunkFilterConversion(List *targetList,
161  TupleDesc cleanTupType,
162  TupleTableSlot *slot);
163 extern AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter,
164  const char *attrName);
165 extern AttrNumber ExecFindJunkAttributeInTlist(List *targetlist,
166  const char *attrName);
168  bool *isNull);
169 extern TupleTableSlot *ExecFilterJunk(JunkFilter *junkfilter,
170  TupleTableSlot *slot);
173 /*
174  * prototypes from functions in execMain.c
175  */
176 extern void ExecutorStart(QueryDesc *queryDesc, int eflags);
177 extern void standard_ExecutorStart(QueryDesc *queryDesc, int eflags);
178 extern void ExecutorRun(QueryDesc *queryDesc,
179  ScanDirection direction, uint64 count);
180 extern void standard_ExecutorRun(QueryDesc *queryDesc,
181  ScanDirection direction, uint64 count);
182 extern void ExecutorFinish(QueryDesc *queryDesc);
183 extern void standard_ExecutorFinish(QueryDesc *queryDesc);
184 extern void ExecutorEnd(QueryDesc *queryDesc);
185 extern void standard_ExecutorEnd(QueryDesc *queryDesc);
186 extern void ExecutorRewind(QueryDesc *queryDesc);
187 extern bool ExecCheckRTPerms(List *rangeTable, bool ereport_on_violation);
188 extern void CheckValidResultRel(Relation resultRel, CmdType operation);
189 extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
190  Relation resultRelationDesc,
191  Index resultRelationIndex,
192  Relation partition_root,
193  int instrument_options);
194 extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid);
195 extern bool ExecContextForcesOids(PlanState *planstate, bool *hasoids);
196 extern void ExecConstraints(ResultRelInfo *resultRelInfo,
197  TupleTableSlot *slot, TupleTableSlot *orig_slot,
198  EState *estate);
199 extern void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo,
200  TupleTableSlot *slot, EState *estate);
201 extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
202 extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
203 extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
204 extern TupleTableSlot *EvalPlanQual(EState *estate, EPQState *epqstate,
205  Relation relation, Index rti, int lockmode,
206  ItemPointer tid, TransactionId priorXmax);
207 extern HeapTuple EvalPlanQualFetch(EState *estate, Relation relation,
208  int lockmode, LockWaitPolicy wait_policy, ItemPointer tid,
209  TransactionId priorXmax);
210 extern void EvalPlanQualInit(EPQState *epqstate, EState *estate,
211  Plan *subplan, List *auxrowmarks, int epqParam);
212 extern void EvalPlanQualSetPlan(EPQState *epqstate,
213  Plan *subplan, List *auxrowmarks);
214 extern void EvalPlanQualSetTuple(EPQState *epqstate, Index rti,
215  HeapTuple tuple);
216 extern HeapTuple EvalPlanQualGetTuple(EPQState *epqstate, Index rti);
218  PartitionDispatch **pd,
219  ResultRelInfo **partitions,
220  TupleConversionMap ***tup_conv_maps,
221  TupleTableSlot **partition_tuple_slot,
222  int *num_parted, int *num_partitions);
223 extern int ExecFindPartition(ResultRelInfo *resultRelInfo,
224  PartitionDispatch *pd,
225  TupleTableSlot *slot,
226  EState *estate);
228 #define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
229 extern void EvalPlanQualFetchRowMarks(EPQState *epqstate);
230 extern TupleTableSlot *EvalPlanQualNext(EPQState *epqstate);
231 extern void EvalPlanQualBegin(EPQState *epqstate, EState *parentestate);
232 extern void EvalPlanQualEnd(EPQState *epqstate);
234 /*
235  * prototypes from functions in execProcnode.c
236  */
237 extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags);
238 extern TupleTableSlot *ExecProcNode(PlanState *node);
239 extern Node *MultiExecProcNode(PlanState *node);
240 extern void ExecEndNode(PlanState *node);
241 extern bool ExecShutdownNode(PlanState *node);
243 /*
244  * prototypes from functions in execQual.c
245  */
247  bool *isNull);
248 extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
249  bool *isNull);
251  ExprContext *econtext,
252  MemoryContext argContext,
253  TupleDesc expectedDesc,
254  bool randomAccess);
256  ExprContext *econtext,
257  bool *isNull,
258  ExprDoneCond *isDone);
259 extern Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext,
260  bool *isNull);
261 extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
262 extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
263 extern bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull);
264 extern int ExecTargetListLength(List *targetlist);
265 extern int ExecCleanTargetListLength(List *targetlist);
266 extern TupleTableSlot *ExecProject(ProjectionInfo *projInfo);
268 /*
269  * prototypes from functions in execScan.c
270  */
271 typedef TupleTableSlot *(*ExecScanAccessMtd) (ScanState *node);
274 extern TupleTableSlot *ExecScan(ScanState *node, ExecScanAccessMtd accessMtd,
275  ExecScanRecheckMtd recheckMtd);
276 extern void ExecAssignScanProjectionInfo(ScanState *node);
277 extern void ExecAssignScanProjectionInfoWithVarno(ScanState *node, Index varno);
278 extern void ExecScanReScan(ScanState *node);
280 /*
281  * prototypes from functions in execTuples.c
282  */
283 extern void ExecInitResultTupleSlot(EState *estate, PlanState *planstate);
284 extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate);
287  TupleDesc tupType);
288 extern TupleDesc ExecTypeFromTL(List *targetList, bool hasoid);
289 extern TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid);
290 extern TupleDesc ExecTypeFromExprList(List *exprList);
291 extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList);
292 extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
294 typedef struct TupOutputState
295 {
301  TupleDesc tupdesc);
302 extern void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull);
303 extern void do_text_output_multiline(TupOutputState *tstate, const char *txt);
304 extern void end_tup_output(TupOutputState *tstate);
306 /*
307  * Write a single line of text given as a C string.
308  *
309  * Should only be used with a single-TEXT-attribute tupdesc.
310  */
311 #define do_text_output_oneline(tstate, str_to_emit) \
312  do { \
313  Datum values_[1]; \
314  bool isnull_[1]; \
315  values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
316  isnull_[0] = false; \
317  do_tup_output(tstate, values_, isnull_); \
318  pfree(DatumGetPointer(values_[0])); \
319  } while (0)
322 /*
323  * prototypes from functions in execUtils.c
324  */
325 extern EState *CreateExecutorState(void);
326 extern void FreeExecutorState(EState *estate);
327 extern ExprContext *CreateExprContext(EState *estate);
329 extern void FreeExprContext(ExprContext *econtext, bool isCommit);
330 extern void ReScanExprContext(ExprContext *econtext);
332 #define ResetExprContext(econtext) \
333  MemoryContextReset((econtext)->ecxt_per_tuple_memory)
337 /* Get an EState's per-output-tuple exprcontext, making it if first use */
338 #define GetPerTupleExprContext(estate) \
339  ((estate)->es_per_tuple_exprcontext ? \
340  (estate)->es_per_tuple_exprcontext : \
341  MakePerTupleExprContext(estate))
343 #define GetPerTupleMemoryContext(estate) \
344  (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
346 /* Reset an EState's per-output-tuple exprcontext, if one's been created */
347 #define ResetPerTupleExprContext(estate) \
348  do { \
349  if ((estate)->es_per_tuple_exprcontext) \
350  ResetExprContext((estate)->es_per_tuple_exprcontext); \
351  } while (0)
353 extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
354 extern void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc);
355 extern void ExecAssignResultTypeFromTL(PlanState *planstate);
356 extern TupleDesc ExecGetResultType(PlanState *planstate);
357 extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList,
358  ExprContext *econtext,
359  TupleTableSlot *slot,
360  TupleDesc inputDesc);
361 extern void ExecAssignProjectionInfo(PlanState *planstate,
362  TupleDesc inputDesc);
363 extern void ExecFreeExprContext(PlanState *planstate);
364 extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc);
365 extern void ExecAssignScanTypeFromOuterPlan(ScanState *scanstate);
367 extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
369 extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
370 extern void ExecCloseScanRelation(Relation scanrel);
372 extern void RegisterExprContextCallback(ExprContext *econtext,
374  Datum arg);
375 extern void UnregisterExprContextCallback(ExprContext *econtext,
377  Datum arg);
379 /*
380  * prototypes from functions in execIndexing.c
381  */
382 extern void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative);
383 extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
385  EState *estate, bool noDupErr, bool *specConflict,
386  List *arbiterIndexes);
387 extern bool ExecCheckIndexConstraints(TupleTableSlot *slot, EState *estate,
388  ItemPointer conflictTid, List *arbiterIndexes);
390  IndexInfo *indexInfo,
391  ItemPointer tupleid,
392  Datum *values, bool *isnull,
393  EState *estate, bool newIndex);
395 /*
396  * prototypes from functions in execReplication.c
397  */
398 extern bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid,
399  LockTupleMode lockmode,
400  TupleTableSlot *searchslot,
401  TupleTableSlot *outslot);
402 extern bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode,
403  TupleTableSlot *searchslot, TupleTableSlot *outslot);
405 extern void ExecSimpleRelationInsert(EState *estate, TupleTableSlot *slot);
406 extern void ExecSimpleRelationUpdate(EState *estate, EPQState *epqstate,
407  TupleTableSlot *searchslot, TupleTableSlot *slot);
408 extern void ExecSimpleRelationDelete(EState *estate, EPQState *epqstate,
409  TupleTableSlot *searchslot);
410 extern void CheckCmdReplicaIdentity(Relation rel, CmdType cmd);
413 #endif /* EXECUTOR_H */
bool(* ExecutorCheckPerms_hook_type)(List *, bool)
Definition: executor.h:96
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:745
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:771
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:458
LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo)
Definition: execMain.c:2180
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:1915
bool ExecSupportsBackwardScan(Plan *node)
Definition: execAmi.c:446
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid)
Definition: execMain.c:1314
ExprContext * CreateExprContext(EState *estate)
Definition: execUtils.c:207
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:2206
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
Definition: execMain.c:2230
uint32 TransactionId
Definition: c.h:393
void ExecScanReScan(ScanState *node)
Definition: execScan.c:327
void ExecAssignScanTypeFromOuterPlan(ScanState *scanstate)
Definition: execUtils.c:720
AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter, const char *attrName)
Definition: execJunk.c:209
bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull)
Definition: execQual.c:5055
Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext, bool *isNull)
Definition: execQual.c:4219
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:1161
void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc)
Definition: execUtils.c:417
void(* ExecutorEnd_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:92
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:896
void standard_ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:386
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:571
void(* ExecutorFinish_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:88
Definition: nodes.h:508
int ExecCleanTargetListLength(List *targetlist)
Definition: execQual.c:5132
TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid)
Definition: execTuples.c:900
void ExecRestrPos(PlanState *node)
Definition: execAmi.c:348
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:235
void ExecSimpleRelationDelete(EState *estate, EPQState *epqstate, TupleTableSlot *searchslot)
TupleTableSlot * slot
Definition: executor.h:296
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:1881
unsigned int Oid
Definition: postgres_ext.h:31
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:684
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:446
HeapTuple EvalPlanQualGetTuple(EPQState *epqstate, Index rti)
Definition: execMain.c:2672
Definition: c.h:1062
char bool
Definition: c.h:199
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
Definition: execTuples.c:986
bool ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:813
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Definition: executor.h:271
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:1404
bool ExecCheckRTPerms(List *rangeTable, bool ereport_on_violation)
Definition: execMain.c:546
void standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:147
Definition: heapam.h:38
bool ExecSupportsMarkRestore(struct Path *pathnode)
Definition: execAmi.c:390
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
Definition: executor.h:272
TupleDesc ExecTypeFromExprList(List *exprList)
Definition: execTuples.c:947
TupleTableSlot * ExecProcNode(PlanState *node)
Definition: execProcnode.c:380
void EvalPlanQualFetchRowMarks(EPQState *epqstate)
Definition: execMain.c:2687
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
Definition: execMain.c:2636
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate)
Definition: execTuples.c:842
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: execMain.c:293
void ExecutorRewind(QueryDesc *queryDesc)
Definition: execMain.c:503
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
Definition: execMain.c:71
bool ExecMaterializesOutput(NodeTag plantype)
Definition: execAmi.c:561
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
Definition: execScan.c:121
RelOptInfo * parent
Definition: relation.h:894
TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
Definition: execQual.c:5214
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:708
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
Definition: execMain.c:68
void ExecAssignResultTypeFromTL(PlanState *planstate)
Definition: execUtils.c:429
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
Definition: execUtils.c:839
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:2838
Definition: sdir.h:22
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:656
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
Definition: execMain.c:2822
void end_tup_output(TupOutputState *tstate)
Definition: execTuples.c:1308
Definition: parsenodes.h:1023
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew)
Definition: execGrouping.c:351
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:407
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:377
void CheckValidResultRel(Relation resultRel, CmdType operation)
Definition: execMain.c:1019
ExprContext * CreateStandaloneExprContext(void)
Definition: execUtils.c:279
Definition: execnodes.h:166
void ExecSimpleRelationInsert(EState *estate, TupleTableSlot *slot)
void ExecReScan(PlanState *node)
Definition: execAmi.c:73
AttrNumber ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
Definition: execJunk.c:221
PGDLLIMPORT ExecutorFinish_hook_type ExecutorFinish_hook
Definition: execMain.c:70
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, TupleTableSlot *orig_slot, EState *estate)
Definition: execMain.c:1787
HeapTuple EvalPlanQualFetch(EState *estate, Relation relation, int lockmode, LockWaitPolicy wait_policy, ItemPointer tid, TransactionId priorXmax)
Definition: execMain.c:2388
PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
Definition: execMain.c:74
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
Definition: execQual.c:4266
uintptr_t Datum
Definition: postgres.h:374
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:3097
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:338
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
Definition: execJunk.c:262
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:624
unsigned int Index
Definition: c.h:361
void InitResultRelInfo(ResultRelInfo *resultRelInfo, Relation resultRelationDesc, Index resultRelationIndex, Relation partition_root, int instrument_options)
Definition: execMain.c:1219
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
Definition: execQual.c:5004
EState * CreateExecutorState(void)
Definition: execUtils.c:72
void(* ExecutorRun_hook_type)(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: executor.h:82
void ReScanExprContext(ExprContext *econtext)
Definition: execUtils.c:365
void ExecCloseScanRelation(Relation scanrel)
Definition: execUtils.c:829
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, TupleDesc inputDesc)
Definition: execUtils.c:481
int ExecTargetListLength(List *targetlist)
Definition: execQual.c:5122
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 RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:870
TupleDesc ExecTypeFromTL(List *targetList, bool hasoid)
Definition: execTuples.c:888
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: execMain.c:283
int ExecFindPartition(ResultRelInfo *resultRelInfo, PartitionDispatch *pd, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:3186
Datum ExecMakeFunctionResultSet(FuncExprState *fcache, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone)
Definition: execQual.c:1614
size_t Size
Definition: c.h:352
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:2652
void ExecMarkPos(PlanState *node)
Definition: execAmi.c:299
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:2617
void EvalPlanQualEnd(EPQState *epqstate)
Definition: execMain.c:3028
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:380
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:2301
Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull)
Definition: execQual.c:1209
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:137
void ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:437
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 * arg
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType)
Definition: execTuples.c:866
DestReceiver * dest
Definition: executor.h:297
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate)
Definition: execTuples.c:852
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:91
void ExecInitResultTupleSlot(EState *estate, PlanState *planstate)
Definition: execTuples.c:832
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:641
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
Definition: execMain.c:69
Definition: relation.h:888
void ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:138
void FreeExecutorState(EState *estate)
Definition: execUtils.c:167