PostgreSQL Source Code  git master
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-2024, 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 "fmgr.h"
19 #include "nodes/lockoptions.h"
20 #include "nodes/parsenodes.h"
21 #include "utils/memutils.h"
22 
23 
24 /*
25  * The "eflags" argument to ExecutorStart and the various ExecInitNode
26  * routines is a bitwise OR of the following flag bits, which tell the
27  * called plan node what to expect. Note that the flags will get modified
28  * as they are passed down the plan tree, since an upper node may require
29  * functionality in its subnode not demanded of the plan as a whole
30  * (example: MergeJoin requires mark/restore capability in its inner input),
31  * or an upper node may shield its input from some functionality requirement
32  * (example: Materialize shields its input from needing to do backward scan).
33  *
34  * EXPLAIN_ONLY indicates that the plan tree is being initialized just so
35  * EXPLAIN can print it out; it will not be run. Hence, no side-effects
36  * of startup should occur. However, error checks (such as permission checks)
37  * should be performed.
38  *
39  * EXPLAIN_GENERIC can only be used together with EXPLAIN_ONLY. It indicates
40  * that a generic plan is being shown using EXPLAIN (GENERIC_PLAN), which
41  * means that missing parameter values must be tolerated. Currently, the only
42  * effect is to suppress execution-time partition pruning.
43  *
44  * REWIND indicates that the plan node should try to efficiently support
45  * rescans without parameter changes. (Nodes must support ExecReScan calls
46  * in any case, but if this flag was not given, they are at liberty to do it
47  * through complete recalculation. Note that a parameter change forces a
48  * full recalculation in any case.)
49  *
50  * BACKWARD indicates that the plan node must respect the es_direction flag.
51  * When this is not passed, the plan node will only be run forwards.
52  *
53  * MARK indicates that the plan node must support Mark/Restore calls.
54  * When this is not passed, no Mark/Restore will occur.
55  *
56  * SKIP_TRIGGERS tells ExecutorStart/ExecutorFinish to skip calling
57  * AfterTriggerBeginQuery/AfterTriggerEndQuery. This does not necessarily
58  * mean that the plan can't queue any AFTER triggers; just that the caller
59  * is responsible for there being a trigger context for them to be queued in.
60  *
61  * WITH_NO_DATA indicates that we are performing REFRESH MATERIALIZED VIEW
62  * ... WITH NO DATA. Currently, the only effect is to suppress errors about
63  * scanning unpopulated materialized views.
64  */
65 #define EXEC_FLAG_EXPLAIN_ONLY 0x0001 /* EXPLAIN, no ANALYZE */
66 #define EXEC_FLAG_EXPLAIN_GENERIC 0x0002 /* EXPLAIN (GENERIC_PLAN) */
67 #define EXEC_FLAG_REWIND 0x0004 /* need efficient rescan */
68 #define EXEC_FLAG_BACKWARD 0x0008 /* need backward scan */
69 #define EXEC_FLAG_MARK 0x0010 /* need mark/restore */
70 #define EXEC_FLAG_SKIP_TRIGGERS 0x0020 /* skip AfterTrigger setup */
71 #define EXEC_FLAG_WITH_NO_DATA 0x0040 /* REFRESH ... WITH NO DATA */
72 
73 
74 /* Hook for plugins to get control in ExecutorStart() */
75 typedef void (*ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags);
77 
78 /* Hook for plugins to get control in ExecutorRun() */
79 typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc,
80  ScanDirection direction,
81  uint64 count,
82  bool execute_once);
84 
85 /* Hook for plugins to get control in ExecutorFinish() */
86 typedef void (*ExecutorFinish_hook_type) (QueryDesc *queryDesc);
88 
89 /* Hook for plugins to get control in ExecutorEnd() */
90 typedef void (*ExecutorEnd_hook_type) (QueryDesc *queryDesc);
92 
93 /* Hook for plugins to get control in ExecCheckPermissions() */
94 typedef bool (*ExecutorCheckPerms_hook_type) (List *rangeTable,
95  List *rtePermInfos,
96  bool ereport_on_violation);
98 
99 
100 /*
101  * prototypes from functions in execAmi.c
102  */
103 struct Path; /* avoid including pathnodes.h here */
104 
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);
111 
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);
119 
120 /*
121  * prototypes from functions in execGrouping.c
122  */
124  int numCols,
125  const AttrNumber *keyColIdx,
126  const Oid *eqOperators,
127  const Oid *collations,
128  PlanState *parent);
129 extern void execTuplesHashPrepare(int numCols,
130  const Oid *eqOperators,
131  Oid **eqFuncOids,
132  FmgrInfo **hashFunctions);
134  TupleDesc inputDesc,
135  int numCols, AttrNumber *keyColIdx,
136  const Oid *eqfuncoids,
137  FmgrInfo *hashfunctions,
138  Oid *collations,
139  long nbuckets, Size additionalsize,
140  MemoryContext tablecxt,
141  MemoryContext tempcxt, bool use_variable_hash_iv);
143  TupleDesc inputDesc,
144  int numCols, AttrNumber *keyColIdx,
145  const Oid *eqfuncoids,
146  FmgrInfo *hashfunctions,
147  Oid *collations,
148  long nbuckets, Size additionalsize,
149  MemoryContext metacxt,
150  MemoryContext tablecxt,
151  MemoryContext tempcxt, bool use_variable_hash_iv);
153  TupleTableSlot *slot,
154  bool *isnew, uint32 *hash);
155 extern uint32 TupleHashTableHash(TupleHashTable hashtable,
156  TupleTableSlot *slot);
158  TupleTableSlot *slot,
159  bool *isnew, uint32 hash);
161  TupleTableSlot *slot,
162  ExprState *eqcomp,
163  FmgrInfo *hashfunctions);
164 extern void ResetTupleHashTable(TupleHashTable hashtable);
165 
166 /*
167  * prototypes from functions in execJunk.c
168  */
169 extern JunkFilter *ExecInitJunkFilter(List *targetList,
170  TupleTableSlot *slot);
171 extern JunkFilter *ExecInitJunkFilterConversion(List *targetList,
172  TupleDesc cleanTupType,
173  TupleTableSlot *slot);
174 extern AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter,
175  const char *attrName);
176 extern AttrNumber ExecFindJunkAttributeInTlist(List *targetlist,
177  const char *attrName);
178 extern TupleTableSlot *ExecFilterJunk(JunkFilter *junkfilter,
179  TupleTableSlot *slot);
180 
181 /*
182  * ExecGetJunkAttribute
183  *
184  * Given a junk filter's input tuple (slot) and a junk attribute's number
185  * previously found by ExecFindJunkAttribute, extract & return the value and
186  * isNull flag of the attribute.
187  */
188 #ifndef FRONTEND
189 static inline Datum
190 ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
191 {
192  Assert(attno > 0);
193  return slot_getattr(slot, attno, isNull);
194 }
195 #endif
196 
197 /*
198  * prototypes from functions in execMain.c
199  */
200 extern void ExecutorStart(QueryDesc *queryDesc, int eflags);
201 extern void standard_ExecutorStart(QueryDesc *queryDesc, int eflags);
202 extern void ExecutorRun(QueryDesc *queryDesc,
203  ScanDirection direction, uint64 count, bool execute_once);
204 extern void standard_ExecutorRun(QueryDesc *queryDesc,
205  ScanDirection direction, uint64 count, bool execute_once);
206 extern void ExecutorFinish(QueryDesc *queryDesc);
207 extern void standard_ExecutorFinish(QueryDesc *queryDesc);
208 extern void ExecutorEnd(QueryDesc *queryDesc);
209 extern void standard_ExecutorEnd(QueryDesc *queryDesc);
210 extern void ExecutorRewind(QueryDesc *queryDesc);
211 extern bool ExecCheckPermissions(List *rangeTable,
212  List *rteperminfos, bool ereport_on_violation);
213 extern void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation,
214  List *mergeActions);
215 extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
216  Relation resultRelationDesc,
217  Index resultRelationIndex,
218  ResultRelInfo *partition_root_rri,
219  int instrument_options);
220 extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid,
221  ResultRelInfo *rootRelInfo);
222 extern List *ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo);
223 extern void ExecConstraints(ResultRelInfo *resultRelInfo,
224  TupleTableSlot *slot, EState *estate);
225 extern bool ExecPartitionCheck(ResultRelInfo *resultRelInfo,
226  TupleTableSlot *slot, EState *estate, bool emitError);
227 extern void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo,
228  TupleTableSlot *slot, EState *estate);
229 extern void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo,
230  TupleTableSlot *slot, EState *estate);
231 extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
232 extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
233 extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
234 extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation,
235  Index rti, TupleTableSlot *inputslot);
236 extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate,
237  Plan *subplan, List *auxrowmarks,
238  int epqParam, List *resultRelations);
239 extern void EvalPlanQualSetPlan(EPQState *epqstate,
240  Plan *subplan, List *auxrowmarks);
241 extern TupleTableSlot *EvalPlanQualSlot(EPQState *epqstate,
242  Relation relation, Index rti);
243 
244 #define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
245 extern bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot);
246 extern TupleTableSlot *EvalPlanQualNext(EPQState *epqstate);
247 extern void EvalPlanQualBegin(EPQState *epqstate);
248 extern void EvalPlanQualEnd(EPQState *epqstate);
249 
250 /*
251  * functions in execProcnode.c
252  */
253 extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags);
254 extern void ExecSetExecProcNode(PlanState *node, ExecProcNodeMtd function);
255 extern Node *MultiExecProcNode(PlanState *node);
256 extern void ExecEndNode(PlanState *node);
257 extern void ExecShutdownNode(PlanState *node);
258 extern void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node);
259 
260 
261 /* ----------------------------------------------------------------
262  * ExecProcNode
263  *
264  * Execute the given node to return a(nother) tuple.
265  * ----------------------------------------------------------------
266  */
267 #ifndef FRONTEND
268 static inline TupleTableSlot *
270 {
271  if (node->chgParam != NULL) /* something changed? */
272  ExecReScan(node); /* let ReScan handle this */
273 
274  return node->ExecProcNode(node);
275 }
276 #endif
277 
278 /*
279  * prototypes from functions in execExpr.c
280  */
281 extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
282 extern ExprState *ExecInitExprWithParams(Expr *node, ParamListInfo ext_params);
283 extern ExprState *ExecInitQual(List *qual, PlanState *parent);
284 extern ExprState *ExecInitCheck(List *qual, PlanState *parent);
285 extern List *ExecInitExprList(List *nodes, PlanState *parent);
286 extern ExprState *ExecBuildAggTrans(AggState *aggstate, struct AggStatePerPhaseData *phase,
287  bool doSort, bool doHash, bool nullcheck);
289  const TupleTableSlotOps *lops, const TupleTableSlotOps *rops,
290  int numCols,
291  const AttrNumber *keyColIdx,
292  const Oid *eqfunctions,
293  const Oid *collations,
294  PlanState *parent);
296  const TupleTableSlotOps *lops,
297  const TupleTableSlotOps *rops,
298  const Oid *eqfunctions,
299  const Oid *collations,
300  const List *param_exprs,
301  PlanState *parent);
302 extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList,
303  ExprContext *econtext,
304  TupleTableSlot *slot,
305  PlanState *parent,
306  TupleDesc inputDesc);
307 extern ProjectionInfo *ExecBuildUpdateProjection(List *targetList,
308  bool evalTargetList,
309  List *targetColnos,
310  TupleDesc relDesc,
311  ExprContext *econtext,
312  TupleTableSlot *slot,
313  PlanState *parent);
314 extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
315 extern ExprState *ExecPrepareQual(List *qual, EState *estate);
316 extern ExprState *ExecPrepareCheck(List *qual, EState *estate);
317 extern List *ExecPrepareExprList(List *nodes, EState *estate);
318 
319 /*
320  * ExecEvalExpr
321  *
322  * Evaluate expression identified by "state" in the execution context
323  * given by "econtext". *isNull is set to the is-null flag for the result,
324  * and the Datum value is the function result.
325  *
326  * The caller should already have switched into the temporary memory
327  * context econtext->ecxt_per_tuple_memory. The convenience entry point
328  * ExecEvalExprSwitchContext() is provided for callers who don't prefer to
329  * do the switch in an outer loop.
330  */
331 #ifndef FRONTEND
332 static inline Datum
334  ExprContext *econtext,
335  bool *isNull)
336 {
337  return state->evalfunc(state, econtext, isNull);
338 }
339 #endif
340 
341 /*
342  * ExecEvalExprSwitchContext
343  *
344  * Same as ExecEvalExpr, but get into the right allocation context explicitly.
345  */
346 #ifndef FRONTEND
347 static inline Datum
349  ExprContext *econtext,
350  bool *isNull)
351 {
352  Datum retDatum;
353  MemoryContext oldContext;
354 
355  oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
356  retDatum = state->evalfunc(state, econtext, isNull);
357  MemoryContextSwitchTo(oldContext);
358  return retDatum;
359 }
360 #endif
361 
362 /*
363  * ExecProject
364  *
365  * Projects a tuple based on projection info and stores it in the slot passed
366  * to ExecBuildProjectionInfo().
367  *
368  * Note: the result is always a virtual tuple; therefore it may reference
369  * the contents of the exprContext's scan tuples and/or temporary results
370  * constructed in the exprContext. If the caller wishes the result to be
371  * valid longer than that data will be valid, he must call ExecMaterializeSlot
372  * on the result slot.
373  */
374 #ifndef FRONTEND
375 static inline TupleTableSlot *
377 {
378  ExprContext *econtext = projInfo->pi_exprContext;
379  ExprState *state = &projInfo->pi_state;
380  TupleTableSlot *slot = state->resultslot;
381  bool isnull;
382 
383  /*
384  * Clear any former contents of the result slot. This makes it safe for
385  * us to use the slot's Datum/isnull arrays as workspace.
386  */
387  ExecClearTuple(slot);
388 
389  /* Run the expression, discarding scalar result from the last column. */
390  (void) ExecEvalExprSwitchContext(state, econtext, &isnull);
391 
392  /*
393  * Successfully formed a result row. Mark the result slot as containing a
394  * valid virtual tuple (inlined version of ExecStoreVirtualTuple()).
395  */
396  slot->tts_flags &= ~TTS_FLAG_EMPTY;
397  slot->tts_nvalid = slot->tts_tupleDescriptor->natts;
398 
399  return slot;
400 }
401 #endif
402 
403 /*
404  * ExecQual - evaluate a qual prepared with ExecInitQual (possibly via
405  * ExecPrepareQual). Returns true if qual is satisfied, else false.
406  *
407  * Note: ExecQual used to have a third argument "resultForNull". The
408  * behavior of this function now corresponds to resultForNull == false.
409  * If you want the resultForNull == true behavior, see ExecCheck.
410  */
411 #ifndef FRONTEND
412 static inline bool
414 {
415  Datum ret;
416  bool isnull;
417 
418  /* short-circuit (here and in ExecInitQual) for empty restriction list */
419  if (state == NULL)
420  return true;
421 
422  /* verify that expression was compiled using ExecInitQual */
423  Assert(state->flags & EEO_FLAG_IS_QUAL);
424 
425  ret = ExecEvalExprSwitchContext(state, econtext, &isnull);
426 
427  /* EEOP_QUAL should never return NULL */
428  Assert(!isnull);
429 
430  return DatumGetBool(ret);
431 }
432 #endif
433 
434 /*
435  * ExecQualAndReset() - evaluate qual with ExecQual() and reset expression
436  * context.
437  */
438 #ifndef FRONTEND
439 static inline bool
441 {
442  bool ret = ExecQual(state, econtext);
443 
444  /* inline ResetExprContext, to avoid ordering issue in this file */
446  return ret;
447 }
448 #endif
449 
450 extern bool ExecCheck(ExprState *state, ExprContext *econtext);
451 
452 /*
453  * prototypes from functions in execSRF.c
454  */
456  ExprContext *econtext, PlanState *parent);
458  ExprContext *econtext,
459  MemoryContext argContext,
460  TupleDesc expectedDesc,
461  bool randomAccess);
463  ExprContext *econtext, PlanState *parent);
465  ExprContext *econtext,
466  MemoryContext argContext,
467  bool *isNull,
468  ExprDoneCond *isDone);
469 
470 /*
471  * prototypes from functions in execScan.c
472  */
473 typedef TupleTableSlot *(*ExecScanAccessMtd) (ScanState *node);
475 
476 extern TupleTableSlot *ExecScan(ScanState *node, ExecScanAccessMtd accessMtd,
477  ExecScanRecheckMtd recheckMtd);
478 extern void ExecAssignScanProjectionInfo(ScanState *node);
479 extern void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno);
480 extern void ExecScanReScan(ScanState *node);
481 
482 /*
483  * prototypes from functions in execTuples.c
484  */
485 extern void ExecInitResultTypeTL(PlanState *planstate);
486 extern void ExecInitResultSlot(PlanState *planstate,
487  const TupleTableSlotOps *tts_ops);
488 extern void ExecInitResultTupleSlotTL(PlanState *planstate,
489  const TupleTableSlotOps *tts_ops);
490 extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate,
491  TupleDesc tupledesc,
492  const TupleTableSlotOps *tts_ops);
494  TupleDesc tupledesc,
495  const TupleTableSlotOps *tts_ops);
496 extern TupleTableSlot *ExecInitNullTupleSlot(EState *estate, TupleDesc tupType,
497  const TupleTableSlotOps *tts_ops);
498 extern TupleDesc ExecTypeFromTL(List *targetList);
499 extern TupleDesc ExecCleanTypeFromTL(List *targetList);
500 extern TupleDesc ExecTypeFromExprList(List *exprList);
501 extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList);
502 extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
503 
504 typedef struct TupOutputState
505 {
509 
511  TupleDesc tupdesc,
512  const TupleTableSlotOps *tts_ops);
513 extern void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull);
514 extern void do_text_output_multiline(TupOutputState *tstate, const char *txt);
515 extern void end_tup_output(TupOutputState *tstate);
516 
517 /*
518  * Write a single line of text given as a C string.
519  *
520  * Should only be used with a single-TEXT-attribute tupdesc.
521  */
522 #define do_text_output_oneline(tstate, str_to_emit) \
523  do { \
524  Datum values_[1]; \
525  bool isnull_[1]; \
526  values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
527  isnull_[0] = false; \
528  do_tup_output(tstate, values_, isnull_); \
529  pfree(DatumGetPointer(values_[0])); \
530  } while (0)
531 
532 
533 /*
534  * prototypes from functions in execUtils.c
535  */
536 extern EState *CreateExecutorState(void);
537 extern void FreeExecutorState(EState *estate);
538 extern ExprContext *CreateExprContext(EState *estate);
539 extern ExprContext *CreateWorkExprContext(EState *estate);
541 extern void FreeExprContext(ExprContext *econtext, bool isCommit);
542 extern void ReScanExprContext(ExprContext *econtext);
543 
544 #define ResetExprContext(econtext) \
545  MemoryContextReset((econtext)->ecxt_per_tuple_memory)
546 
548 
549 /* Get an EState's per-output-tuple exprcontext, making it if first use */
550 #define GetPerTupleExprContext(estate) \
551  ((estate)->es_per_tuple_exprcontext ? \
552  (estate)->es_per_tuple_exprcontext : \
553  MakePerTupleExprContext(estate))
554 
555 #define GetPerTupleMemoryContext(estate) \
556  (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
557 
558 /* Reset an EState's per-output-tuple exprcontext, if one's been created */
559 #define ResetPerTupleExprContext(estate) \
560  do { \
561  if ((estate)->es_per_tuple_exprcontext) \
562  ResetExprContext((estate)->es_per_tuple_exprcontext); \
563  } while (0)
564 
565 extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
566 extern TupleDesc ExecGetResultType(PlanState *planstate);
567 extern const TupleTableSlotOps *ExecGetResultSlotOps(PlanState *planstate,
568  bool *isfixed);
569 extern void ExecAssignProjectionInfo(PlanState *planstate,
570  TupleDesc inputDesc);
571 extern void ExecConditionalAssignProjectionInfo(PlanState *planstate,
572  TupleDesc inputDesc, int varno);
573 extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc);
574 extern void ExecCreateScanSlotFromOuterPlan(EState *estate,
575  ScanState *scanstate,
576  const TupleTableSlotOps *tts_ops);
577 
578 extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
579 
580 extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
581 
582 extern void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos);
583 extern void ExecCloseRangeTableRelations(EState *estate);
584 extern void ExecCloseResultRelations(EState *estate);
585 
586 static inline RangeTblEntry *
588 {
589  return (RangeTblEntry *) list_nth(estate->es_range_table, rti - 1);
590 }
591 
592 extern Relation ExecGetRangeTableRelation(EState *estate, Index rti);
593 extern void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo,
594  Index rti);
595 
596 extern int executor_errposition(EState *estate, int location);
597 
598 extern void RegisterExprContextCallback(ExprContext *econtext,
600  Datum arg);
601 extern void UnregisterExprContextCallback(ExprContext *econtext,
603  Datum arg);
604 
605 extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
606  bool *isNull);
608  bool *isNull);
609 
610 extern int ExecTargetListLength(List *targetlist);
611 extern int ExecCleanTargetListLength(List *targetlist);
612 
613 extern TupleTableSlot *ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo);
614 extern TupleTableSlot *ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo);
615 extern TupleTableSlot *ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo);
617 extern TupleConversionMap *ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate);
618 
619 extern Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate);
620 extern Bitmapset *ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate);
621 extern Bitmapset *ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate);
622 extern Bitmapset *ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate);
623 extern Bitmapset *ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate);
624 
625 /*
626  * prototypes from functions in execIndexing.c
627  */
628 extern void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative);
629 extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
630 extern List *ExecInsertIndexTuples(ResultRelInfo *resultRelInfo,
631  TupleTableSlot *slot, EState *estate,
632  bool update,
633  bool noDupErr,
634  bool *specConflict, List *arbiterIndexes,
635  bool onlySummarizing);
636 extern bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo,
637  TupleTableSlot *slot,
638  EState *estate, ItemPointer conflictTid,
639  List *arbiterIndexes);
641  IndexInfo *indexInfo,
642  ItemPointer tupleid,
643  const Datum *values, const bool *isnull,
644  EState *estate, bool newIndex);
645 
646 /*
647  * prototypes from functions in execReplication.c
648  */
650 extern bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid,
651  LockTupleMode lockmode,
652  TupleTableSlot *searchslot,
653  TupleTableSlot *outslot);
654 extern bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode,
655  TupleTableSlot *searchslot, TupleTableSlot *outslot);
656 
657 extern void ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo,
658  EState *estate, TupleTableSlot *slot);
659 extern void ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo,
660  EState *estate, EPQState *epqstate,
661  TupleTableSlot *searchslot, TupleTableSlot *slot);
662 extern void ExecSimpleRelationDelete(ResultRelInfo *resultRelInfo,
663  EState *estate, EPQState *epqstate,
664  TupleTableSlot *searchslot);
665 extern void CheckCmdReplicaIdentity(Relation rel, CmdType cmd);
666 
667 extern void CheckSubscriptionRelkind(char relkind, const char *nspname,
668  const char *relname);
669 
670 /*
671  * prototypes from functions in nodeModifyTable.c
672  */
674  TupleTableSlot *planSlot,
675  TupleTableSlot *oldSlot);
677  Oid resultoid,
678  bool missing_ok,
679  bool update_cache);
680 
681 #endif /* EXECUTOR_H */
int16 AttrNumber
Definition: attnum.h:21
static Datum values[MAXATTR]
Definition: bootstrap.c:152
unsigned int uint32
Definition: c.h:493
#define PGDLLIMPORT
Definition: c.h:1303
unsigned char bool
Definition: c.h:443
unsigned int Index
Definition: c.h:601
size_t Size
Definition: c.h:592
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:217
TupleTableSlot *(* ExecProcNodeMtd)(struct PlanState *pstate)
Definition: execnodes.h:1028
ExprDoneCond
Definition: execnodes.h:302
#define EEO_FLAG_IS_QUAL
Definition: execnodes.h:76
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:493
bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode, TupleTableSlot *searchslot, TupleTableSlot *outslot)
bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid, LockTupleMode lockmode, TupleTableSlot *searchslot, TupleTableSlot *outslot)
LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo)
Definition: execMain.c:2349
Bitmapset * ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1324
ExprState * ExecBuildAggTrans(AggState *aggstate, struct AggStatePerPhaseData *phase, bool doSort, bool doHash, bool nullcheck)
void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation, List *mergeActions)
Definition: execMain.c:1026
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno)
Definition: execScan.c:283
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
Definition: execMain.c:68
void ExecSimpleRelationDelete(ResultRelInfo *resultRelInfo, EState *estate, EPQState *epqstate, TupleTableSlot *searchslot)
void CheckSubscriptionRelkind(char relkind, const char *nspname, const char *relname)
void EvalPlanQualBegin(EPQState *epqstate)
Definition: execMain.c:2749
TupleTableSlot * EvalPlanQual(EPQState *epqstate, Relation relation, Index rti, TupleTableSlot *inputslot)
Definition: execMain.c:2468
TupleTableSlot * ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1138
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
Definition: execExpr.c:732
StrategyNumber get_equal_strategy_number_for_am(Oid am)
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
Definition: execMain.c:65
void ReScanExprContext(ExprContext *econtext)
Definition: execUtils.c:441
ExprContext * CreateWorkExprContext(EState *estate)
Definition: execUtils.c:319
bool ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool emitError)
Definition: execMain.c:1790
void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull)
Definition: execTuples.c:2274
void(* ExecutorRun_hook_type)(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: executor.h:79
bool ExecCheck(ExprState *state, ExprContext *econtext)
Definition: execExpr.c:839
JunkFilter * ExecInitJunkFilter(List *targetList, TupleTableSlot *slot)
Definition: execJunk.c:60
const TupleTableSlotOps * ExecGetResultSlotOps(PlanState *planstate, bool *isfixed)
Definition: execUtils.c:502
Bitmapset * ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1288
ExprState * ExecInitExprWithParams(Expr *node, ParamListInfo ext_params)
Definition: execExpr.c:164
SetExprState * ExecInitTableFunctionResult(Expr *expr, ExprContext *econtext, PlanState *parent)
Definition: execSRF.c:56
void execTuplesHashPrepare(int numCols, const Oid *eqOperators, Oid **eqFuncOids, FmgrInfo **hashFunctions)
Definition: execGrouping.c:95
void(* ExecutorFinish_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:86
Tuplestorestate * ExecMakeTableFunctionResult(SetExprState *setexpr, ExprContext *econtext, MemoryContext argContext, TupleDesc expectedDesc, bool randomAccess)
Definition: execSRF.c:101
static RangeTblEntry * exec_rt_fetch(Index rti, EState *estate)
Definition: executor.h:587
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
Definition: execMain.c:2733
TupleHashTable BuildTupleHashTable(PlanState *parent, TupleDesc inputDesc, int numCols, AttrNumber *keyColIdx, const Oid *eqfuncoids, FmgrInfo *hashfunctions, Oid *collations, long nbuckets, Size additionalsize, MemoryContext tablecxt, MemoryContext tempcxt, bool use_variable_hash_iv)
Definition: execGrouping.c:254
List * ExecInitExprList(List *nodes, PlanState *parent)
Definition: execExpr.c:319
void ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:467
void EvalPlanQualInit(EPQState *epqstate, EState *parentestate, Plan *subplan, List *auxrowmarks, int epqParam, List *resultRelations)
Definition: execMain.c:2537
void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos)
Definition: execUtils.c:728
TupleTableSlot * ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1182
TupleDesc ExecCleanTypeFromTL(List *targetList)
Definition: execTuples.c:1949
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:2049
int executor_errposition(EState *estate, int location)
Definition: execUtils.c:870
ProjectionInfo * ExecBuildUpdateProjection(List *targetList, bool evalTargetList, List *targetColnos, TupleDesc relDesc, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent)
Definition: execExpr.c:514
void ExecInitResultSlot(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1778
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1846
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
Definition: execTuples.c:2029
TupleHashEntry LookupTupleHashEntryHash(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 hash)
Definition: execGrouping.c:360
bool ExecSupportsMarkRestore(struct Path *pathnode)
Definition: execAmi.c:417
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
Definition: execScan.c:156
Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno, bool *isNull)
Definition: execUtils.c:1058
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:414
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:213
AttrNumber ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
Definition: execJunk.c:222
void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo, Index rti)
Definition: execUtils.c:814
void end_tup_output(TupOutputState *tstate)
Definition: execTuples.c:2332
TupleTableSlot * ExecGetUpdateNewTuple(ResultRelInfo *relinfo, TupleTableSlot *planSlot, TupleTableSlot *oldSlot)
void InitResultRelInfo(ResultRelInfo *resultRelInfo, Relation resultRelationDesc, Index resultRelationIndex, ResultRelInfo *partition_root_rri, int instrument_options)
Definition: execMain.c:1199
bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, List *arbiterIndexes)
Definition: execIndexing.c:527
void ExecMarkPos(PlanState *node)
Definition: execAmi.c:326
ExprState * ExecPrepareCheck(List *qual, EState *estate)
Definition: execExpr.c:783
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
Definition: execMain.c:2398
static TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
Definition: executor.h:376
void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node)
Definition: execProcnode.c:843
Datum ExecMakeFunctionResultSet(SetExprState *fcache, ExprContext *econtext, MemoryContext argContext, bool *isNull, ExprDoneCond *isDone)
Definition: execSRF.c:497
void standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:141
ExprContext * CreateStandaloneExprContext(void)
Definition: execUtils.c:355
void ExecCreateScanSlotFromOuterPlan(EState *estate, ScanState *scanstate, const TupleTableSlotOps *tts_ops)
Definition: execUtils.c:659
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:407
EState * CreateExecutorState(void)
Definition: execUtils.c:88
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:557
ExprContext * CreateExprContext(EState *estate)
Definition: execUtils.c:304
void ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo, EState *estate, EPQState *epqstate, TupleTableSlot *searchslot, TupleTableSlot *slot)
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1810
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 *hash)
Definition: execGrouping.c:305
void EvalPlanQualEnd(EPQState *epqstate)
Definition: execMain.c:2980
SetExprState * ExecInitFunctionResultSet(Expr *expr, ExprContext *econtext, PlanState *parent)
Definition: execSRF.c:444
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1754
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
Definition: execMain.c:2579
void CheckCmdReplicaIdentity(Relation rel, CmdType cmd)
void ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo, EState *estate, TupleTableSlot *slot)
AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter, const char *attrName)
Definition: execJunk.c:210
PGDLLIMPORT ExecutorFinish_hook_type ExecutorFinish_hook
Definition: execMain.c:67
void ExecutorRewind(QueryDesc *queryDesc)
Definition: execMain.c:533
void do_text_output_multiline(TupOutputState *tstate, const char *txt)
Definition: execTuples.c:2302
void ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:767
TupleTableSlot * ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1160
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:483
void ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:124
Relation ExecGetRangeTableRelation(EState *estate, Index rti)
Definition: execUtils.c:762
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Definition: executor.h:473
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:538
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1830
void(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
Definition: executor.h:75
static bool ExecQual(ExprState *state, ExprContext *econtext)
Definition: executor.h:413
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
Definition: execJunk.c:247
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:923
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:647
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
Definition: executor.h:474
bool(* ExecutorCheckPerms_hook_type)(List *rangeTable, List *rtePermInfos, bool ereport_on_violation)
Definition: executor.h:94
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
Definition: execExpr.c:127
uint32 TupleHashTableHash(TupleHashTable hashtable, TupleTableSlot *slot)
Definition: execGrouping.c:337
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:308
bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
Definition: execMain.c:2624
void ExecConditionalAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc, int varno)
Definition: execUtils.c:558
void(* ExecutorEnd_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:90
ResultRelInfo * ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid, bool missing_ok, bool update_cache)
Node * MultiExecProcNode(PlanState *node)
Definition: execProcnode.c:502
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1798
ExprState * ExecInitCheck(List *qual, PlanState *parent)
Definition: execExpr.c:299
void ExecCloseIndices(ResultRelInfo *resultRelInfo)
Definition: execIndexing.c:231
void RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:897
List * ExecInsertIndexTuples(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool update, bool noDupErr, bool *specConflict, List *arbiterIndexes, bool onlySummarizing)
Definition: execIndexing.c:298
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
Definition: executor.h:440
TupleConversionMap * ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate)
Definition: execUtils.c:1232
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:270
int ExecTargetListLength(List *targetlist)
Definition: execUtils.c:1109
void FreeExecutorState(EState *estate)
Definition: execUtils.c:189
struct TupOutputState TupOutputState
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:684
void ExecCloseResultRelations(EState *estate)
Definition: execMain.c:1515
ExprState * ExecPrepareQual(List *qual, EState *estate)
Definition: execExpr.c:760
TupleConversionMap * ExecGetChildToRootMap(ResultRelInfo *resultRelInfo)
Definition: execUtils.c:1206
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
Definition: execMain.c:2375
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent, TupleDesc inputDesc)
Definition: execExpr.c:354
bool ExecMaterializesOutput(NodeTag plantype)
Definition: execAmi.c:635
List * ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo)
Definition: execMain.c:1370
void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative)
Definition: execIndexing.c:156
int ExecCleanTargetListLength(List *targetlist)
Definition: execUtils.c:1119
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
Definition: execUtils.c:844
void ExecScanReScan(ScanState *node)
Definition: execScan.c:297
bool ExecSupportsBackwardScan(Plan *node)
Definition: execAmi.c:510
Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull)
Definition: execUtils.c:995
ExprState * ExecBuildGroupingEqual(TupleDesc ldesc, TupleDesc rdesc, const TupleTableSlotOps *lops, const TupleTableSlotOps *rops, int numCols, const AttrNumber *keyColIdx, const Oid *eqfunctions, const Oid *collations, PlanState *parent)
Definition: execExpr.c:3922
PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
Definition: execMain.c:71
TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, ExprState *eqcomp, FmgrInfo *hashfunctions)
Definition: execGrouping.c:392
void ExecReScan(PlanState *node)
Definition: execAmi.c:76
TupleHashTable BuildTupleHashTableExt(PlanState *parent, TupleDesc inputDesc, int numCols, AttrNumber *keyColIdx, const Oid *eqfuncoids, FmgrInfo *hashfunctions, Oid *collations, long nbuckets, Size additionalsize, MemoryContext metacxt, MemoryContext tablecxt, MemoryContext tempcxt, bool use_variable_hash_iv)
Definition: execGrouping.c:153
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:2254
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
Definition: execMain.c:66
List * ExecPrepareExprList(List *nodes, EState *estate)
Definition: execExpr.c:806
ExprContext * MakePerTupleExprContext(EState *estate)
Definition: execUtils.c:456
TupleDesc ExecTypeFromExprList(List *exprList)
Definition: execTuples.c:1996
TupleDesc ExecTypeFromTL(List *targetList)
Definition: execTuples.c:1937
TupleTableSlot * EvalPlanQualSlot(EPQState *epqstate, Relation relation, Index rti)
Definition: execMain.c:2596
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:333
Bitmapset * ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1309
bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid)
Definition: execCurrent.c:44
void ResetTupleHashTable(TupleHashTable hashtable)
Definition: execGrouping.c:284
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:297
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid, ResultRelInfo *rootRelInfo)
Definition: execMain.c:1294
void standard_ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:476
void ExecRestrPos(PlanState *node)
Definition: execAmi.c:375
void ExecCloseRangeTableRelations(EState *estate)
Definition: execMain.c:1575
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:348
void check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo, ItemPointer tupleid, const Datum *values, const bool *isnull, EState *estate, bool newIndex)
Definition: execIndexing.c:915
ExprState * execTuplesMatchPrepare(TupleDesc desc, int numCols, const AttrNumber *keyColIdx, const Oid *eqOperators, const Oid *collations, PlanState *parent)
Definition: execGrouping.c:58
void ExecSetExecProcNode(PlanState *node, ExecProcNodeMtd function)
Definition: execProcnode.c:425
void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1843
Bitmapset * ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1267
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1914
JunkFilter * ExecInitJunkFilterConversion(List *targetList, TupleDesc cleanTupType, TupleTableSlot *slot)
Definition: execJunk.c:137
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:697
bool ExecCheckPermissions(List *rangeTable, List *rteperminfos, bool ereport_on_violation)
Definition: execMain.c:579
static Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
Definition: executor.h:190
Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate)
Definition: execUtils.c:1395
ExprState * ExecBuildParamSetEqual(TupleDesc desc, const TupleTableSlotOps *lops, const TupleTableSlotOps *rops, const Oid *eqfunctions, const Oid *collations, const List *param_exprs, PlanState *parent)
Definition: execExpr.c:4079
static TupleTableSlot * ExecProcNode(PlanState *node)
Definition: executor.h:269
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:142
void standard_ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:416
Assert(fmt[strlen(fmt) - 1] !='\n')
LockTupleMode
Definition: lockoptions.h:50
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:371
CmdType
Definition: nodes.h:253
NodeTag
Definition: nodes.h:27
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:124
WCOKind
Definition: parsenodes.h:1317
NameData attname
Definition: pg_attribute.h:41
void * arg
NameData relname
Definition: pg_class.h:38
static void * list_nth(const List *list, int n)
Definition: pg_list.h:299
static bool DatumGetBool(Datum X)
Definition: postgres.h:90
uintptr_t Datum
Definition: postgres.h:64
unsigned int Oid
Definition: postgres_ext.h:31
static unsigned hash(unsigned *uv, int n)
Definition: rege_dfa.c:715
ScanDirection
Definition: sdir.h:25
uint16 StrategyNumber
Definition: stratnum.h:22
List * es_range_table
Definition: execnodes.h:624
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:263
Definition: fmgr.h:57
Definition: pg_list.h:54
Definition: nodes.h:129
Bitmapset * chgParam
Definition: execnodes.h:1075
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1049
ExprState pi_state
Definition: execnodes.h:362
ExprContext * pi_exprContext
Definition: execnodes.h:364
TupleTableSlot * slot
Definition: executor.h:506
DestReceiver * dest
Definition: executor.h:507
TupleDesc tts_tupleDescriptor
Definition: tuptable.h:123
AttrNumber tts_nvalid
Definition: tuptable.h:120
uint16 tts_flags
Definition: tuptable.h:118
Definition: type.h:95
Definition: regguts.h:323
#define TTS_FLAG_EMPTY
Definition: tuptable.h:95
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:433
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
Definition: tuptable.h:389