PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
executor.h
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-2016, 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
16 
17 #include "executor/execdesc.h"
18 #include "nodes/parsenodes.h"
19 
20 
21 /*
22  * The "eflags" argument to ExecutorStart and the various ExecInitNode
23  * routines is a bitwise OR of the following flag bits, which tell the
24  * called plan node what to expect. Note that the flags will get modified
25  * as they are passed down the plan tree, since an upper node may require
26  * functionality in its subnode not demanded of the plan as a whole
27  * (example: MergeJoin requires mark/restore capability in its inner input),
28  * or an upper node may shield its input from some functionality requirement
29  * (example: Materialize shields its input from needing to do backward scan).
30  *
31  * EXPLAIN_ONLY indicates that the plan tree is being initialized just so
32  * EXPLAIN can print it out; it will not be run. Hence, no side-effects
33  * of startup should occur. However, error checks (such as permission checks)
34  * should be performed.
35  *
36  * REWIND indicates that the plan node should try to efficiently support
37  * rescans without parameter changes. (Nodes must support ExecReScan calls
38  * in any case, but if this flag was not given, they are at liberty to do it
39  * through complete recalculation. Note that a parameter change forces a
40  * full recalculation in any case.)
41  *
42  * BACKWARD indicates that the plan node must respect the es_direction flag.
43  * When this is not passed, the plan node will only be run forwards.
44  *
45  * MARK indicates that the plan node must support Mark/Restore calls.
46  * When this is not passed, no Mark/Restore will occur.
47  *
48  * SKIP_TRIGGERS tells ExecutorStart/ExecutorFinish to skip calling
49  * AfterTriggerBeginQuery/AfterTriggerEndQuery. This does not necessarily
50  * mean that the plan can't queue any AFTER triggers; just that the caller
51  * is responsible for there being a trigger context for them to be queued in.
52  *
53  * WITH/WITHOUT_OIDS tell the executor to emit tuples with or without space
54  * for OIDs, respectively. These are currently used only for CREATE TABLE AS.
55  * If neither is set, the plan may or may not produce tuples including OIDs.
56  */
57 #define EXEC_FLAG_EXPLAIN_ONLY 0x0001 /* EXPLAIN, no ANALYZE */
58 #define EXEC_FLAG_REWIND 0x0002 /* need efficient rescan */
59 #define EXEC_FLAG_BACKWARD 0x0004 /* need backward scan */
60 #define EXEC_FLAG_MARK 0x0008 /* need mark/restore */
61 #define EXEC_FLAG_SKIP_TRIGGERS 0x0010 /* skip AfterTrigger calls */
62 #define EXEC_FLAG_WITH_OIDS 0x0020 /* force OIDs in returned tuples */
63 #define EXEC_FLAG_WITHOUT_OIDS 0x0040 /* force no OIDs in returned tuples */
64 #define EXEC_FLAG_WITH_NO_DATA 0x0080 /* rel scannability doesn't matter */
65 
66 
67 /*
68  * ExecEvalExpr was formerly a function containing a switch statement;
69  * now it's just a macro invoking the function pointed to by an ExprState
70  * node. Beware of double evaluation of the ExprState argument!
71  */
72 #define ExecEvalExpr(expr, econtext, isNull, isDone) \
73  ((*(expr)->evalfunc) (expr, econtext, isNull, isDone))
74 
75 
76 /* Hook for plugins to get control in ExecutorStart() */
77 typedef void (*ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags);
79 
80 /* Hook for plugins to get control in ExecutorRun() */
81 typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc,
82  ScanDirection direction,
83  uint64 count);
85 
86 /* Hook for plugins to get control in ExecutorFinish() */
87 typedef void (*ExecutorFinish_hook_type) (QueryDesc *queryDesc);
89 
90 /* Hook for plugins to get control in ExecutorEnd() */
91 typedef void (*ExecutorEnd_hook_type) (QueryDesc *queryDesc);
93 
94 /* Hook for plugins to get control in ExecCheckRTPerms() */
97 
98 
99 /*
100  * prototypes from functions in execAmi.c
101  */
102 struct Path; /* avoid including relation.h here */
103 
104 extern void ExecReScan(PlanState *node);
105 extern void ExecMarkPos(PlanState *node);
106 extern void ExecRestrPos(PlanState *node);
107 extern bool ExecSupportsMarkRestore(struct Path *pathnode);
108 extern bool ExecSupportsBackwardScan(Plan *node);
109 extern bool ExecMaterializesOutput(NodeTag plantype);
110 
111 /*
112  * prototypes from functions in execCurrent.c
113  */
114 extern bool execCurrentOf(CurrentOfExpr *cexpr,
115  ExprContext *econtext,
116  Oid table_oid,
117  ItemPointer current_tid);
118 
119 /*
120  * prototypes from functions in execGrouping.c
121  */
122 extern bool execTuplesMatch(TupleTableSlot *slot1,
123  TupleTableSlot *slot2,
124  int numCols,
125  AttrNumber *matchColIdx,
126  FmgrInfo *eqfunctions,
127  MemoryContext evalContext);
128 extern bool execTuplesUnequal(TupleTableSlot *slot1,
129  TupleTableSlot *slot2,
130  int numCols,
131  AttrNumber *matchColIdx,
132  FmgrInfo *eqfunctions,
133  MemoryContext evalContext);
134 extern FmgrInfo *execTuplesMatchPrepare(int numCols,
135  Oid *eqOperators);
136 extern void execTuplesHashPrepare(int numCols,
137  Oid *eqOperators,
138  FmgrInfo **eqFunctions,
139  FmgrInfo **hashFunctions);
140 extern TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx,
141  FmgrInfo *eqfunctions,
142  FmgrInfo *hashfunctions,
143  long nbuckets, Size entrysize,
144  MemoryContext tablecxt,
145  MemoryContext tempcxt);
147  TupleTableSlot *slot,
148  bool *isnew);
150  TupleTableSlot *slot,
151  FmgrInfo *eqfunctions,
152  FmgrInfo *hashfunctions);
153 
154 /*
155  * prototypes from functions in execJunk.c
156  */
157 extern JunkFilter *ExecInitJunkFilter(List *targetList, bool hasoid,
158  TupleTableSlot *slot);
159 extern JunkFilter *ExecInitJunkFilterConversion(List *targetList,
160  TupleDesc cleanTupType,
161  TupleTableSlot *slot);
162 extern AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter,
163  const char *attrName);
164 extern AttrNumber ExecFindJunkAttributeInTlist(List *targetlist,
165  const char *attrName);
167  bool *isNull);
168 extern TupleTableSlot *ExecFilterJunk(JunkFilter *junkfilter,
169  TupleTableSlot *slot);
170 
171 
172 /*
173  * prototypes from functions in execMain.c
174  */
175 extern void ExecutorStart(QueryDesc *queryDesc, int eflags);
176 extern void standard_ExecutorStart(QueryDesc *queryDesc, int eflags);
177 extern void ExecutorRun(QueryDesc *queryDesc,
178  ScanDirection direction, uint64 count);
179 extern void standard_ExecutorRun(QueryDesc *queryDesc,
180  ScanDirection direction, uint64 count);
181 extern void ExecutorFinish(QueryDesc *queryDesc);
182 extern void standard_ExecutorFinish(QueryDesc *queryDesc);
183 extern void ExecutorEnd(QueryDesc *queryDesc);
184 extern void standard_ExecutorEnd(QueryDesc *queryDesc);
185 extern void ExecutorRewind(QueryDesc *queryDesc);
186 extern bool ExecCheckRTPerms(List *rangeTable, bool ereport_on_violation);
187 extern void CheckValidResultRel(Relation resultRel, CmdType operation);
188 extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
189  Relation resultRelationDesc,
190  Index resultRelationIndex,
191  int instrument_options);
192 extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid);
193 extern bool ExecContextForcesOids(PlanState *planstate, bool *hasoids);
194 extern void ExecConstraints(ResultRelInfo *resultRelInfo,
195  TupleTableSlot *slot, EState *estate);
196 extern void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo,
197  TupleTableSlot *slot, EState *estate);
198 extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
199 extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
200 extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
201 extern TupleTableSlot *EvalPlanQual(EState *estate, EPQState *epqstate,
202  Relation relation, Index rti, int lockmode,
203  ItemPointer tid, TransactionId priorXmax);
204 extern HeapTuple EvalPlanQualFetch(EState *estate, Relation relation,
205  int lockmode, LockWaitPolicy wait_policy, ItemPointer tid,
206  TransactionId priorXmax);
207 extern void EvalPlanQualInit(EPQState *epqstate, EState *estate,
208  Plan *subplan, List *auxrowmarks, int epqParam);
209 extern void EvalPlanQualSetPlan(EPQState *epqstate,
210  Plan *subplan, List *auxrowmarks);
211 extern void EvalPlanQualSetTuple(EPQState *epqstate, Index rti,
212  HeapTuple tuple);
213 extern HeapTuple EvalPlanQualGetTuple(EPQState *epqstate, Index rti);
214 
215 #define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
216 extern void EvalPlanQualFetchRowMarks(EPQState *epqstate);
217 extern TupleTableSlot *EvalPlanQualNext(EPQState *epqstate);
218 extern void EvalPlanQualBegin(EPQState *epqstate, EState *parentestate);
219 extern void EvalPlanQualEnd(EPQState *epqstate);
220 
221 /*
222  * prototypes from functions in execProcnode.c
223  */
224 extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags);
225 extern TupleTableSlot *ExecProcNode(PlanState *node);
226 extern Node *MultiExecProcNode(PlanState *node);
227 extern void ExecEndNode(PlanState *node);
228 extern bool ExecShutdownNode(PlanState *node);
229 
230 /*
231  * prototypes from functions in execQual.c
232  */
234  bool *isNull);
235 extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
236  bool *isNull);
238  ExprContext *econtext,
239  MemoryContext argContext,
240  TupleDesc expectedDesc,
241  bool randomAccess);
242 extern Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext,
243  bool *isNull, ExprDoneCond *isDone);
244 extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
245 extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
246 extern bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull);
247 extern int ExecTargetListLength(List *targetlist);
248 extern int ExecCleanTargetListLength(List *targetlist);
249 extern TupleTableSlot *ExecProject(ProjectionInfo *projInfo,
250  ExprDoneCond *isDone);
251 
252 /*
253  * prototypes from functions in execScan.c
254  */
255 typedef TupleTableSlot *(*ExecScanAccessMtd) (ScanState *node);
257 
258 extern TupleTableSlot *ExecScan(ScanState *node, ExecScanAccessMtd accessMtd,
259  ExecScanRecheckMtd recheckMtd);
260 extern void ExecAssignScanProjectionInfo(ScanState *node);
261 extern void ExecAssignScanProjectionInfoWithVarno(ScanState *node, Index varno);
262 extern void ExecScanReScan(ScanState *node);
263 
264 /*
265  * prototypes from functions in execTuples.c
266  */
267 extern void ExecInitResultTupleSlot(EState *estate, PlanState *planstate);
268 extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate);
271  TupleDesc tupType);
272 extern TupleDesc ExecTypeFromTL(List *targetList, bool hasoid);
273 extern TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid);
274 extern TupleDesc ExecTypeFromExprList(List *exprList);
275 extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList);
276 extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
277 
278 typedef struct TupOutputState
279 {
283 
285  TupleDesc tupdesc);
286 extern void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull);
287 extern void do_text_output_multiline(TupOutputState *tstate, char *text);
288 extern void end_tup_output(TupOutputState *tstate);
289 
290 /*
291  * Write a single line of text given as a C string.
292  *
293  * Should only be used with a single-TEXT-attribute tupdesc.
294  */
295 #define do_text_output_oneline(tstate, str_to_emit) \
296  do { \
297  Datum values_[1]; \
298  bool isnull_[1]; \
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])); \
303  } while (0)
304 
305 
306 /*
307  * prototypes from functions in execUtils.c
308  */
309 extern EState *CreateExecutorState(void);
310 extern void FreeExecutorState(EState *estate);
311 extern ExprContext *CreateExprContext(EState *estate);
313 extern void FreeExprContext(ExprContext *econtext, bool isCommit);
314 extern void ReScanExprContext(ExprContext *econtext);
315 
316 #define ResetExprContext(econtext) \
317  MemoryContextReset((econtext)->ecxt_per_tuple_memory)
318 
320 
321 /* Get an EState's per-output-tuple exprcontext, making it if first use */
322 #define GetPerTupleExprContext(estate) \
323  ((estate)->es_per_tuple_exprcontext ? \
324  (estate)->es_per_tuple_exprcontext : \
325  MakePerTupleExprContext(estate))
326 
327 #define GetPerTupleMemoryContext(estate) \
328  (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
329 
330 /* Reset an EState's per-output-tuple exprcontext, if one's been created */
331 #define ResetPerTupleExprContext(estate) \
332  do { \
333  if ((estate)->es_per_tuple_exprcontext) \
334  ResetExprContext((estate)->es_per_tuple_exprcontext); \
335  } while (0)
336 
337 extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
338 extern void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc);
339 extern void ExecAssignResultTypeFromTL(PlanState *planstate);
340 extern TupleDesc ExecGetResultType(PlanState *planstate);
341 extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList,
342  ExprContext *econtext,
343  TupleTableSlot *slot,
344  TupleDesc inputDesc);
345 extern void ExecAssignProjectionInfo(PlanState *planstate,
346  TupleDesc inputDesc);
347 extern void ExecFreeExprContext(PlanState *planstate);
348 extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc);
349 extern void ExecAssignScanTypeFromOuterPlan(ScanState *scanstate);
350 
351 extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
352 
353 extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
354 extern void ExecCloseScanRelation(Relation scanrel);
355 
356 extern void RegisterExprContextCallback(ExprContext *econtext,
358  Datum arg);
359 extern void UnregisterExprContextCallback(ExprContext *econtext,
361  Datum arg);
362 
363 /*
364  * prototypes from functions in execIndexing.c
365  */
366 extern void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative);
367 extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
369  EState *estate, bool noDupErr, bool *specConflict,
370  List *arbiterIndexes);
371 extern bool ExecCheckIndexConstraints(TupleTableSlot *slot, EState *estate,
372  ItemPointer conflictTid, List *arbiterIndexes);
374  IndexInfo *indexInfo,
375  ItemPointer tupleid,
376  Datum *values, bool *isnull,
377  EState *estate, bool newIndex);
378 
379 
380 #endif /* EXECUTOR_H */
bool(* ExecutorCheckPerms_hook_type)(List *, bool)
Definition: executor.h:95
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:757
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:783
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:464
LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo)
Definition: execMain.c:2030
TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions)
Definition: execGrouping.c:422
Definition: fmgr.h:53
bool ExecCheckIndexConstraints(TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, List *arbiterIndexes)
Definition: execIndexing.c:471
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1765
bool ExecSupportsBackwardScan(Plan *node)
Definition: execAmi.c:441
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid)
Definition: execMain.c:1271
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:54
bool execTuplesUnequal(TupleTableSlot *slot1, TupleTableSlot *slot2, int numCols, AttrNumber *matchColIdx, FmgrInfo *eqfunctions, MemoryContext evalContext)
Definition: execGrouping.c:124
TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions, long nbuckets, Size entrysize, MemoryContext tablecxt, MemoryContext tempcxt)
Definition: execGrouping.c:275
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc)
Definition: execTuples.c:1282
TupleTableSlot * ExecProject(ProjectionInfo *projInfo, ExprDoneCond *isDone)
Definition: execQual.c:5495
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
Definition: execMain.c:2056
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
Definition: execMain.c:2080
uint32 TransactionId
Definition: c.h:382
void ExecScanReScan(ScanState *node)
Definition: execScan.c:351
void ExecAssignScanTypeFromOuterPlan(ScanState *scanstate)
Definition: execUtils.c:732
AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter, const char *attrName)
Definition: execJunk.c:209
bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull)
Definition: execQual.c:5239
void execTuplesHashPrepare(int numCols, Oid *eqOperators, FmgrInfo **eqFunctions, FmgrInfo **hashFunctions)
Definition: execGrouping.c:218
Definition: plannodes.h:96
Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno, bool *isNull)
Definition: execQual.c:1212
void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc)
Definition: execUtils.c:423
void(* ExecutorEnd_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:91
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:908
void standard_ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:383
void ExecCloseIndices(ResultRelInfo *resultRelInfo)
Definition: execIndexing.c:224
FmgrInfo * execTuplesMatchPrepare(int numCols, Oid *eqOperators)
Definition: execGrouping.c:189
Node * MultiExecProcNode(PlanState *node)
Definition: execProcnode.c:561
void(* ExecutorFinish_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:87
Definition: nodes.h:489
int ExecCleanTargetListLength(List *targetlist)
Definition: execQual.c:5316
TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid)
Definition: execTuples.c:950
void ExecRestrPos(PlanState *node)
Definition: execAmi.c:344
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:259
TupleTableSlot * slot
Definition: executor.h:280
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:2057
unsigned int Oid
Definition: postgres_ext.h:31
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:696
NodeTag
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:443
HeapTuple EvalPlanQualGetTuple(EPQState *epqstate, Index rti)
Definition: execMain.c:2522
#define PGDLLIMPORT
Definition: c.h:1032
char bool
Definition: c.h:188
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
Definition: execTuples.c:1036
bool ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:799
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Definition: executor.h:255
Definition: type.h:90
void(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
Definition: executor.h:77
bool ExecContextForcesOids(PlanState *planstate, bool *hasoids)
Definition: execMain.c:1360
bool ExecCheckRTPerms(List *rangeTable, bool ereport_on_violation)
Definition: execMain.c:543
void standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:144
LockTupleMode
Definition: heapam.h:38
bool ExecSupportsMarkRestore(struct Path *pathnode)
Definition: execAmi.c:386
Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone)
Definition: execQual.c:4404
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
Definition: executor.h:256
TupleDesc ExecTypeFromExprList(List *exprList)
Definition: execTuples.c:997
TupleTableSlot * ExecProcNode(PlanState *node)
Definition: execProcnode.c:374
void EvalPlanQualFetchRowMarks(EPQState *epqstate)
Definition: execMain.c:2537
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
Definition: execMain.c:2486
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate)
Definition: execTuples.c:892
void InitResultRelInfo(ResultRelInfo *resultRelInfo, Relation resultRelationDesc, Index resultRelationIndex, int instrument_options)
Definition: execMain.c:1212
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: execMain.c:290
void ExecutorRewind(QueryDesc *queryDesc)
Definition: execMain.c:500
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
Definition: execMain.c:68
bool ExecMaterializesOutput(NodeTag plantype)
Definition: execAmi.c:578
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
Definition: execScan.c:121
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1686
RelOptInfo * parent
Definition: relation.h:835
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:720
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
Definition: execMain.c:65
void ExecAssignResultTypeFromTL(PlanState *planstate)
Definition: execUtils.c:435
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
Definition: execUtils.c:851
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:2688
ScanDirection
Definition: sdir.h:22
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:668
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
Definition: execMain.c:2672
void end_tup_output(TupOutputState *tstate)
Definition: execTuples.c:1359
WCOKind
Definition: parsenodes.h:925
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew)
Definition: execGrouping.c:331
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:413
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:374
void CheckValidResultRel(Relation resultRel, CmdType operation)
Definition: execMain.c:1014
ExprContext * CreateStandaloneExprContext(void)
Definition: execUtils.c:283
ExprDoneCond
Definition: execnodes.h:159
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:67
HeapTuple EvalPlanQualFetch(EState *estate, Relation relation, int lockmode, LockWaitPolicy wait_policy, ItemPointer tid, TransactionId priorXmax)
Definition: execMain.c:2238
PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
Definition: execMain.c:71
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
Definition: execQual.c:4452
uintptr_t Datum
Definition: postgres.h:374
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:344
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
Definition: execJunk.c:262
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:614
unsigned int Index
Definition: c.h:350
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
Definition: execQual.c:5188
EState * CreateExecutorState(void)
Definition: execUtils.c:72
void(* ExecutorRun_hook_type)(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: executor.h:81
void ReScanExprContext(ExprContext *econtext)
Definition: execUtils.c:371
void ExecCloseScanRelation(Relation scanrel)
Definition: execUtils.c:841
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, TupleDesc inputDesc)
Definition: execUtils.c:487
int ExecTargetListLength(List *targetlist)
Definition: execQual.c:5306
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:268
void RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:882
TupleDesc ExecTypeFromTL(List *targetList, bool hasoid)
Definition: execTuples.c:938
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: execMain.c:280
size_t Size
Definition: c.h:341
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, Index varno)
Definition: execScan.c:271
void EvalPlanQualSetTuple(EPQState *epqstate, Index rti, HeapTuple tuple)
Definition: execMain.c:2502
void ExecMarkPos(PlanState *node)
Definition: execAmi.c:295
static Datum values[MAXATTR]
Definition: bootstrap.c:160
void EvalPlanQualInit(EPQState *epqstate, EState *estate, Plan *subplan, List *auxrowmarks, int epqParam)
Definition: execMain.c:2467
void EvalPlanQualEnd(EPQState *epqstate)
Definition: execMain.c:2878
void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull)
Definition: execTuples.c:1300
ExprContext * MakePerTupleExprContext(EState *estate)
Definition: execUtils.c:386
TupleTableSlot * EvalPlanQual(EState *estate, EPQState *epqstate, Relation relation, Index rti, int lockmode, ItemPointer tid, TransactionId priorXmax)
Definition: execMain.c:2151
Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull)
Definition: execQual.c:1260
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:136
void ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:434
void check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo, ItemPointer tupleid, Datum *values, bool *isnull, EState *estate, bool newIndex)
Definition: execIndexing.c:861
void * arg
Definition: c.h:423
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType)
Definition: execTuples.c:916
DestReceiver * dest
Definition: executor.h:281
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate)
Definition: execTuples.c:902
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:85
void ExecInitResultTupleSlot(EState *estate, PlanState *planstate)
Definition: execTuples.c:882
Definition: pg_list.h:45
void do_text_output_multiline(TupOutputState *tstate, char *text)
Definition: execTuples.c:1328
int16 AttrNumber
Definition: attnum.h:21
LockWaitPolicy
Definition: lockoptions.h:36
CmdType
Definition: nodes.h:593
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
Definition: execMain.c:66
Definition: relation.h:829
void ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:135
void FreeExecutorState(EState *estate)
Definition: execUtils.c:169