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-2023, 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 extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
215  Relation resultRelationDesc,
216  Index resultRelationIndex,
217  ResultRelInfo *partition_root_rri,
218  int instrument_options);
219 extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid,
220  ResultRelInfo *rootRelInfo);
221 extern List *ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo);
222 extern void ExecConstraints(ResultRelInfo *resultRelInfo,
223  TupleTableSlot *slot, EState *estate);
224 extern bool ExecPartitionCheck(ResultRelInfo *resultRelInfo,
225  TupleTableSlot *slot, EState *estate, bool emitError);
226 extern void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo,
227  TupleTableSlot *slot, EState *estate);
228 extern void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo,
229  TupleTableSlot *slot, EState *estate);
230 extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
231 extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
232 extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
233 extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation,
234  Index rti, TupleTableSlot *inputslot);
235 extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate,
236  Plan *subplan, List *auxrowmarks, int epqParam);
237 extern void EvalPlanQualSetPlan(EPQState *epqstate,
238  Plan *subplan, List *auxrowmarks);
239 extern TupleTableSlot *EvalPlanQualSlot(EPQState *epqstate,
240  Relation relation, Index rti);
241 
242 #define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
243 extern bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot);
244 extern TupleTableSlot *EvalPlanQualNext(EPQState *epqstate);
245 extern void EvalPlanQualBegin(EPQState *epqstate);
246 extern void EvalPlanQualEnd(EPQState *epqstate);
247 
248 /*
249  * functions in execProcnode.c
250  */
251 extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags);
252 extern void ExecSetExecProcNode(PlanState *node, ExecProcNodeMtd function);
253 extern Node *MultiExecProcNode(PlanState *node);
254 extern void ExecEndNode(PlanState *node);
255 extern void ExecShutdownNode(PlanState *node);
256 extern void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node);
257 
258 
259 /* ----------------------------------------------------------------
260  * ExecProcNode
261  *
262  * Execute the given node to return a(nother) tuple.
263  * ----------------------------------------------------------------
264  */
265 #ifndef FRONTEND
266 static inline TupleTableSlot *
268 {
269  if (node->chgParam != NULL) /* something changed? */
270  ExecReScan(node); /* let ReScan handle this */
271 
272  return node->ExecProcNode(node);
273 }
274 #endif
275 
276 /*
277  * prototypes from functions in execExpr.c
278  */
279 extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
280 extern ExprState *ExecInitExprWithParams(Expr *node, ParamListInfo ext_params);
281 extern ExprState *ExecInitQual(List *qual, PlanState *parent);
282 extern ExprState *ExecInitCheck(List *qual, PlanState *parent);
283 extern List *ExecInitExprList(List *nodes, PlanState *parent);
284 extern ExprState *ExecBuildAggTrans(AggState *aggstate, struct AggStatePerPhaseData *phase,
285  bool doSort, bool doHash, bool nullcheck);
287  const TupleTableSlotOps *lops, const TupleTableSlotOps *rops,
288  int numCols,
289  const AttrNumber *keyColIdx,
290  const Oid *eqfunctions,
291  const Oid *collations,
292  PlanState *parent);
294  const TupleTableSlotOps *lops,
295  const TupleTableSlotOps *rops,
296  const Oid *eqfunctions,
297  const Oid *collations,
298  const List *param_exprs,
299  PlanState *parent);
300 extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList,
301  ExprContext *econtext,
302  TupleTableSlot *slot,
303  PlanState *parent,
304  TupleDesc inputDesc);
305 extern ProjectionInfo *ExecBuildUpdateProjection(List *targetList,
306  bool evalTargetList,
307  List *targetColnos,
308  TupleDesc relDesc,
309  ExprContext *econtext,
310  TupleTableSlot *slot,
311  PlanState *parent);
312 extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
313 extern ExprState *ExecPrepareQual(List *qual, EState *estate);
314 extern ExprState *ExecPrepareCheck(List *qual, EState *estate);
315 extern List *ExecPrepareExprList(List *nodes, EState *estate);
316 
317 /*
318  * ExecEvalExpr
319  *
320  * Evaluate expression identified by "state" in the execution context
321  * given by "econtext". *isNull is set to the is-null flag for the result,
322  * and the Datum value is the function result.
323  *
324  * The caller should already have switched into the temporary memory
325  * context econtext->ecxt_per_tuple_memory. The convenience entry point
326  * ExecEvalExprSwitchContext() is provided for callers who don't prefer to
327  * do the switch in an outer loop.
328  */
329 #ifndef FRONTEND
330 static inline Datum
332  ExprContext *econtext,
333  bool *isNull)
334 {
335  return state->evalfunc(state, econtext, isNull);
336 }
337 #endif
338 
339 /*
340  * ExecEvalExprSwitchContext
341  *
342  * Same as ExecEvalExpr, but get into the right allocation context explicitly.
343  */
344 #ifndef FRONTEND
345 static inline Datum
347  ExprContext *econtext,
348  bool *isNull)
349 {
350  Datum retDatum;
351  MemoryContext oldContext;
352 
353  oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
354  retDatum = state->evalfunc(state, econtext, isNull);
355  MemoryContextSwitchTo(oldContext);
356  return retDatum;
357 }
358 #endif
359 
360 /*
361  * ExecProject
362  *
363  * Projects a tuple based on projection info and stores it in the slot passed
364  * to ExecBuildProjectionInfo().
365  *
366  * Note: the result is always a virtual tuple; therefore it may reference
367  * the contents of the exprContext's scan tuples and/or temporary results
368  * constructed in the exprContext. If the caller wishes the result to be
369  * valid longer than that data will be valid, he must call ExecMaterializeSlot
370  * on the result slot.
371  */
372 #ifndef FRONTEND
373 static inline TupleTableSlot *
375 {
376  ExprContext *econtext = projInfo->pi_exprContext;
377  ExprState *state = &projInfo->pi_state;
378  TupleTableSlot *slot = state->resultslot;
379  bool isnull;
380 
381  /*
382  * Clear any former contents of the result slot. This makes it safe for
383  * us to use the slot's Datum/isnull arrays as workspace.
384  */
385  ExecClearTuple(slot);
386 
387  /* Run the expression, discarding scalar result from the last column. */
388  (void) ExecEvalExprSwitchContext(state, econtext, &isnull);
389 
390  /*
391  * Successfully formed a result row. Mark the result slot as containing a
392  * valid virtual tuple (inlined version of ExecStoreVirtualTuple()).
393  */
394  slot->tts_flags &= ~TTS_FLAG_EMPTY;
395  slot->tts_nvalid = slot->tts_tupleDescriptor->natts;
396 
397  return slot;
398 }
399 #endif
400 
401 /*
402  * ExecQual - evaluate a qual prepared with ExecInitQual (possibly via
403  * ExecPrepareQual). Returns true if qual is satisfied, else false.
404  *
405  * Note: ExecQual used to have a third argument "resultForNull". The
406  * behavior of this function now corresponds to resultForNull == false.
407  * If you want the resultForNull == true behavior, see ExecCheck.
408  */
409 #ifndef FRONTEND
410 static inline bool
412 {
413  Datum ret;
414  bool isnull;
415 
416  /* short-circuit (here and in ExecInitQual) for empty restriction list */
417  if (state == NULL)
418  return true;
419 
420  /* verify that expression was compiled using ExecInitQual */
421  Assert(state->flags & EEO_FLAG_IS_QUAL);
422 
423  ret = ExecEvalExprSwitchContext(state, econtext, &isnull);
424 
425  /* EEOP_QUAL should never return NULL */
426  Assert(!isnull);
427 
428  return DatumGetBool(ret);
429 }
430 #endif
431 
432 /*
433  * ExecQualAndReset() - evaluate qual with ExecQual() and reset expression
434  * context.
435  */
436 #ifndef FRONTEND
437 static inline bool
439 {
440  bool ret = ExecQual(state, econtext);
441 
442  /* inline ResetExprContext, to avoid ordering issue in this file */
444  return ret;
445 }
446 #endif
447 
448 extern bool ExecCheck(ExprState *state, ExprContext *econtext);
449 
450 /*
451  * prototypes from functions in execSRF.c
452  */
454  ExprContext *econtext, PlanState *parent);
456  ExprContext *econtext,
457  MemoryContext argContext,
458  TupleDesc expectedDesc,
459  bool randomAccess);
461  ExprContext *econtext, PlanState *parent);
463  ExprContext *econtext,
464  MemoryContext argContext,
465  bool *isNull,
466  ExprDoneCond *isDone);
467 
468 /*
469  * prototypes from functions in execScan.c
470  */
471 typedef TupleTableSlot *(*ExecScanAccessMtd) (ScanState *node);
473 
474 extern TupleTableSlot *ExecScan(ScanState *node, ExecScanAccessMtd accessMtd,
475  ExecScanRecheckMtd recheckMtd);
476 extern void ExecAssignScanProjectionInfo(ScanState *node);
477 extern void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno);
478 extern void ExecScanReScan(ScanState *node);
479 
480 /*
481  * prototypes from functions in execTuples.c
482  */
483 extern void ExecInitResultTypeTL(PlanState *planstate);
484 extern void ExecInitResultSlot(PlanState *planstate,
485  const TupleTableSlotOps *tts_ops);
486 extern void ExecInitResultTupleSlotTL(PlanState *planstate,
487  const TupleTableSlotOps *tts_ops);
488 extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate,
489  TupleDesc tupledesc,
490  const TupleTableSlotOps *tts_ops);
492  TupleDesc tupledesc,
493  const TupleTableSlotOps *tts_ops);
494 extern TupleTableSlot *ExecInitNullTupleSlot(EState *estate, TupleDesc tupType,
495  const TupleTableSlotOps *tts_ops);
496 extern TupleDesc ExecTypeFromTL(List *targetList);
497 extern TupleDesc ExecCleanTypeFromTL(List *targetList);
498 extern TupleDesc ExecTypeFromExprList(List *exprList);
499 extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList);
500 extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
501 
502 typedef struct TupOutputState
503 {
507 
509  TupleDesc tupdesc,
510  const TupleTableSlotOps *tts_ops);
511 extern void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull);
512 extern void do_text_output_multiline(TupOutputState *tstate, const char *txt);
513 extern void end_tup_output(TupOutputState *tstate);
514 
515 /*
516  * Write a single line of text given as a C string.
517  *
518  * Should only be used with a single-TEXT-attribute tupdesc.
519  */
520 #define do_text_output_oneline(tstate, str_to_emit) \
521  do { \
522  Datum values_[1]; \
523  bool isnull_[1]; \
524  values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
525  isnull_[0] = false; \
526  do_tup_output(tstate, values_, isnull_); \
527  pfree(DatumGetPointer(values_[0])); \
528  } while (0)
529 
530 
531 /*
532  * prototypes from functions in execUtils.c
533  */
534 extern EState *CreateExecutorState(void);
535 extern void FreeExecutorState(EState *estate);
536 extern ExprContext *CreateExprContext(EState *estate);
537 extern ExprContext *CreateWorkExprContext(EState *estate);
539 extern void FreeExprContext(ExprContext *econtext, bool isCommit);
540 extern void ReScanExprContext(ExprContext *econtext);
541 
542 #define ResetExprContext(econtext) \
543  MemoryContextReset((econtext)->ecxt_per_tuple_memory)
544 
546 
547 /* Get an EState's per-output-tuple exprcontext, making it if first use */
548 #define GetPerTupleExprContext(estate) \
549  ((estate)->es_per_tuple_exprcontext ? \
550  (estate)->es_per_tuple_exprcontext : \
551  MakePerTupleExprContext(estate))
552 
553 #define GetPerTupleMemoryContext(estate) \
554  (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
555 
556 /* Reset an EState's per-output-tuple exprcontext, if one's been created */
557 #define ResetPerTupleExprContext(estate) \
558  do { \
559  if ((estate)->es_per_tuple_exprcontext) \
560  ResetExprContext((estate)->es_per_tuple_exprcontext); \
561  } while (0)
562 
563 extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
564 extern TupleDesc ExecGetResultType(PlanState *planstate);
565 extern const TupleTableSlotOps *ExecGetResultSlotOps(PlanState *planstate,
566  bool *isfixed);
567 extern void ExecAssignProjectionInfo(PlanState *planstate,
568  TupleDesc inputDesc);
569 extern void ExecConditionalAssignProjectionInfo(PlanState *planstate,
570  TupleDesc inputDesc, int varno);
571 extern void ExecFreeExprContext(PlanState *planstate);
572 extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc);
573 extern void ExecCreateScanSlotFromOuterPlan(EState *estate,
574  ScanState *scanstate,
575  const TupleTableSlotOps *tts_ops);
576 
577 extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
578 
579 extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
580 
581 extern void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos);
582 extern void ExecCloseRangeTableRelations(EState *estate);
583 extern void ExecCloseResultRelations(EState *estate);
584 
585 static inline RangeTblEntry *
587 {
588  return (RangeTblEntry *) list_nth(estate->es_range_table, rti - 1);
589 }
590 
591 extern Relation ExecGetRangeTableRelation(EState *estate, Index rti);
592 extern void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo,
593  Index rti);
594 
595 extern int executor_errposition(EState *estate, int location);
596 
597 extern void RegisterExprContextCallback(ExprContext *econtext,
599  Datum arg);
600 extern void UnregisterExprContextCallback(ExprContext *econtext,
602  Datum arg);
603 
604 extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
605  bool *isNull);
607  bool *isNull);
608 
609 extern int ExecTargetListLength(List *targetlist);
610 extern int ExecCleanTargetListLength(List *targetlist);
611 
612 extern TupleTableSlot *ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo);
613 extern TupleTableSlot *ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo);
614 extern TupleTableSlot *ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo);
616 extern TupleConversionMap *ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate);
617 
618 extern Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate);
619 extern Bitmapset *ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate);
620 extern Bitmapset *ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate);
621 extern Bitmapset *ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate);
622 extern Bitmapset *ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate);
623 
624 /*
625  * prototypes from functions in execIndexing.c
626  */
627 extern void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative);
628 extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
629 extern List *ExecInsertIndexTuples(ResultRelInfo *resultRelInfo,
630  TupleTableSlot *slot, EState *estate,
631  bool update,
632  bool noDupErr,
633  bool *specConflict, List *arbiterIndexes,
634  bool onlySummarizing);
635 extern bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo,
636  TupleTableSlot *slot,
637  EState *estate, ItemPointer conflictTid,
638  List *arbiterIndexes);
640  IndexInfo *indexInfo,
641  ItemPointer tupleid,
642  Datum *values, bool *isnull,
643  EState *estate, bool newIndex);
644 
645 /*
646  * prototypes from functions in execReplication.c
647  */
648 extern bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid,
649  LockTupleMode lockmode,
650  TupleTableSlot *searchslot,
651  TupleTableSlot *outslot);
652 extern bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode,
653  TupleTableSlot *searchslot, TupleTableSlot *outslot);
654 
655 extern void ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo,
656  EState *estate, TupleTableSlot *slot);
657 extern void ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo,
658  EState *estate, EPQState *epqstate,
659  TupleTableSlot *searchslot, TupleTableSlot *slot);
660 extern void ExecSimpleRelationDelete(ResultRelInfo *resultRelInfo,
661  EState *estate, EPQState *epqstate,
662  TupleTableSlot *searchslot);
663 extern void CheckCmdReplicaIdentity(Relation rel, CmdType cmd);
664 
665 extern void CheckSubscriptionRelkind(char relkind, const char *nspname,
666  const char *relname);
667 
668 /*
669  * prototypes from functions in nodeModifyTable.c
670  */
672  TupleTableSlot *planSlot,
673  TupleTableSlot *oldSlot);
675  Oid resultoid,
676  bool missing_ok,
677  bool update_cache);
678 
679 #endif /* EXECUTOR_H */
int16 AttrNumber
Definition: attnum.h:21
static Datum values[MAXATTR]
Definition: bootstrap.c:156
unsigned int uint32
Definition: c.h:490
#define PGDLLIMPORT
Definition: c.h:1303
unsigned char bool
Definition: c.h:440
unsigned int Index
Definition: c.h:598
size_t Size
Definition: c.h:589
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:211
TupleTableSlot *(* ExecProcNodeMtd)(struct PlanState *pstate)
Definition: execnodes.h:1020
ExprDoneCond
Definition: execnodes.h:296
#define EEO_FLAG_IS_QUAL
Definition: execnodes.h:75
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:498
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:2338
Bitmapset * ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1350
ExprState * ExecBuildAggTrans(AggState *aggstate, struct AggStatePerPhaseData *phase, bool doSort, bool doHash, bool nullcheck)
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno)
Definition: execScan.c:285
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
Definition: execMain.c:76
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:2720
TupleTableSlot * EvalPlanQual(EPQState *epqstate, Relation relation, Index rti, TupleTableSlot *inputslot)
Definition: execMain.c:2457
TupleTableSlot * ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1169
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
Definition: execExpr.c:735
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
Definition: execMain.c:73
void ReScanExprContext(ExprContext *econtext)
Definition: execUtils.c:446
ExprContext * CreateWorkExprContext(EState *estate)
Definition: execUtils.c:324
bool ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool emitError)
Definition: execMain.c:1779
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:842
JunkFilter * ExecInitJunkFilter(List *targetList, TupleTableSlot *slot)
Definition: execJunk.c:60
const TupleTableSlotOps * ExecGetResultSlotOps(PlanState *planstate, bool *isfixed)
Definition: execUtils.c:507
Bitmapset * ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1319
ExprState * ExecInitExprWithParams(Expr *node, ParamListInfo ext_params)
Definition: execExpr.c:164
SetExprState * ExecInitTableFunctionResult(Expr *expr, ExprContext *econtext, PlanState *parent)
Definition: execSRF.c:57
void execTuplesHashPrepare(int numCols, const Oid *eqOperators, Oid **eqFuncOids, FmgrInfo **hashFunctions)
Definition: execGrouping.c:96
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:102
static RangeTblEntry * exec_rt_fetch(Index rti, EState *estate)
Definition: executor.h:586
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
Definition: execMain.c:2704
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:255
List * ExecInitExprList(List *nodes, PlanState *parent)
Definition: execExpr.c:322
void ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:462
void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos)
Definition: execUtils.c:759
TupleTableSlot * ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1213
TupleDesc ExecCleanTypeFromTL(List *targetList)
Definition: execTuples.c:1951
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:2038
int executor_errposition(EState *estate, int location)
Definition: execUtils.c:901
ProjectionInfo * ExecBuildUpdateProjection(List *targetList, bool evalTargetList, List *targetColnos, TupleDesc relDesc, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent)
Definition: execExpr.c:517
void ExecInitResultSlot(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1780
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1848
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
Definition: execTuples.c:2031
TupleHashEntry LookupTupleHashEntryHash(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 hash)
Definition: execGrouping.c:361
bool ExecSupportsMarkRestore(struct Path *pathnode)
Definition: execAmi.c:419
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
Definition: execScan.c:158
Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno, bool *isNull)
Definition: execUtils.c:1089
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:419
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:845
void end_tup_output(TupOutputState *tstate)
Definition: execTuples.c:2334
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:1188
bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, List *arbiterIndexes)
Definition: execIndexing.c:522
void ExecMarkPos(PlanState *node)
Definition: execAmi.c:328
ExprState * ExecPrepareCheck(List *qual, EState *estate)
Definition: execExpr.c:786
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
Definition: execMain.c:2387
static TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
Definition: executor.h:374
void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node)
Definition: execProcnode.c:849
Datum ExecMakeFunctionResultSet(SetExprState *fcache, ExprContext *econtext, MemoryContext argContext, bool *isNull, ExprDoneCond *isDone)
Definition: execSRF.c:498
void standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:149
ExprContext * CreateStandaloneExprContext(void)
Definition: execUtils.c:360
void ExecCreateScanSlotFromOuterPlan(EState *estate, ScanState *scanstate, const TupleTableSlotOps *tts_ops)
Definition: execUtils.c:690
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:402
EState * CreateExecutorState(void)
Definition: execUtils.c:93
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:557
ExprContext * CreateExprContext(EState *estate)
Definition: execUtils.c:309
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:1812
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 *hash)
Definition: execGrouping.c:306
void EvalPlanQualEnd(EPQState *epqstate)
Definition: execMain.c:2933
SetExprState * ExecInitFunctionResultSet(Expr *expr, ExprContext *econtext, PlanState *parent)
Definition: execSRF.c:445
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1756
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
Definition: execMain.c:2550
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:75
void ExecutorRewind(QueryDesc *queryDesc)
Definition: execMain.c:528
void do_text_output_multiline(TupOutputState *tstate, const char *txt)
Definition: execTuples.c:2304
void ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:773
TupleTableSlot * ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1191
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:488
void ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:132
Relation ExecGetRangeTableRelation(EState *estate, Index rti)
Definition: execUtils.c:793
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Definition: executor.h:471
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:543
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1832
void(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
Definition: executor.h:75
void check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo, ItemPointer tupleid, Datum *values, bool *isnull, EState *estate, bool newIndex)
Definition: execIndexing.c:910
static bool ExecQual(ExprState *state, ExprContext *econtext)
Definition: executor.h:411
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
Definition: execJunk.c:247
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:954
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:678
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
Definition: executor.h:472
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:338
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:312
bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
Definition: execMain.c:2595
void ExecConditionalAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc, int varno)
Definition: execUtils.c:563
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:1800
ExprState * ExecInitCheck(List *qual, PlanState *parent)
Definition: execExpr.c:302
void ExecCloseIndices(ResultRelInfo *resultRelInfo)
Definition: execIndexing.c:231
void RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:928
List * ExecInsertIndexTuples(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool update, bool noDupErr, bool *specConflict, List *arbiterIndexes, bool onlySummarizing)
Definition: execIndexing.c:293
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
Definition: executor.h:438
TupleConversionMap * ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate)
Definition: execUtils.c:1263
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:272
int ExecTargetListLength(List *targetlist)
Definition: execUtils.c:1140
void FreeExecutorState(EState *estate)
Definition: execUtils.c:194
struct TupOutputState TupOutputState
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:715
void ExecCloseResultRelations(EState *estate)
Definition: execMain.c:1504
ExprState * ExecPrepareQual(List *qual, EState *estate)
Definition: execExpr.c:763
TupleConversionMap * ExecGetChildToRootMap(ResultRelInfo *resultRelInfo)
Definition: execUtils.c:1237
void EvalPlanQualInit(EPQState *epqstate, EState *parentestate, Plan *subplan, List *auxrowmarks, int epqParam)
Definition: execMain.c:2511
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
Definition: execMain.c:2364
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent, TupleDesc inputDesc)
Definition: execExpr.c:357
bool ExecMaterializesOutput(NodeTag plantype)
Definition: execAmi.c:637
List * ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo)
Definition: execMain.c:1359
void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative)
Definition: execIndexing.c:156
int ExecCleanTargetListLength(List *targetlist)
Definition: execUtils.c:1150
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
Definition: execUtils.c:875
void ExecScanReScan(ScanState *node)
Definition: execScan.c:299
bool ExecSupportsBackwardScan(Plan *node)
Definition: execAmi.c:512
Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull)
Definition: execUtils.c:1026
void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull)
Definition: execTuples.c:2276
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:3860
PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
Definition: execMain.c:79
TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, ExprState *eqcomp, FmgrInfo *hashfunctions)
Definition: execGrouping.c:393
void ExecReScan(PlanState *node)
Definition: execAmi.c:78
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:154
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:2256
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
Definition: execMain.c:74
List * ExecPrepareExprList(List *nodes, EState *estate)
Definition: execExpr.c:809
ExprContext * MakePerTupleExprContext(EState *estate)
Definition: execUtils.c:461
TupleDesc ExecTypeFromExprList(List *exprList)
Definition: execTuples.c:1998
TupleDesc ExecTypeFromTL(List *targetList)
Definition: execTuples.c:1939
TupleTableSlot * EvalPlanQualSlot(EPQState *epqstate, Relation relation, Index rti)
Definition: execMain.c:2567
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:331
Bitmapset * ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1340
bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid)
Definition: execCurrent.c:44
void ResetTupleHashTable(TupleHashTable hashtable)
Definition: execGrouping.c:285
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:301
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid, ResultRelInfo *rootRelInfo)
Definition: execMain.c:1283
void standard_ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:471
void ExecRestrPos(PlanState *node)
Definition: execAmi.c:377
void ExecCloseRangeTableRelations(EState *estate)
Definition: execMain.c:1564
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:346
ExprState * execTuplesMatchPrepare(TupleDesc desc, int numCols, const AttrNumber *keyColIdx, const Oid *eqOperators, const Oid *collations, PlanState *parent)
Definition: execGrouping.c:59
void ExecSetExecProcNode(PlanState *node, ExecProcNodeMtd function)
Definition: execProcnode.c:425
void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1832
Bitmapset * ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1298
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1903
JunkFilter * ExecInitJunkFilterConversion(List *targetList, TupleDesc cleanTupType, TupleTableSlot *slot)
Definition: execJunk.c:137
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:728
bool ExecCheckPermissions(List *rangeTable, List *rteperminfos, bool ereport_on_violation)
Definition: execMain.c:574
static Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
Definition: executor.h:190
Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate)
Definition: execUtils.c:1412
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:4017
static TupleTableSlot * ExecProcNode(PlanState *node)
Definition: executor.h:267
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:142
void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation)
Definition: execMain.c:987
void ExecFreeExprContext(PlanState *planstate)
Definition: execUtils.c:658
void standard_ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:411
Assert(fmt[strlen(fmt) - 1] !='\n')
LockTupleMode
Definition: lockoptions.h:50
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:314
CmdType
Definition: nodes.h:274
NodeTag
Definition: nodes.h:27
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:138
WCOKind
Definition: parsenodes.h:1313
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
List * es_range_table
Definition: execnodes.h:618
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:257
Definition: fmgr.h:57
Definition: pg_list.h:54
Definition: nodes.h:129
Bitmapset * chgParam
Definition: execnodes.h:1067
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1041
ExprState pi_state
Definition: execnodes.h:356
ExprContext * pi_exprContext
Definition: execnodes.h:358
TupleTableSlot * slot
Definition: executor.h:504
DestReceiver * dest
Definition: executor.h:505
TupleDesc tts_tupleDescriptor
Definition: tuptable.h:124
AttrNumber tts_nvalid
Definition: tuptable.h:121
uint16 tts_flags
Definition: tuptable.h:119
Definition: type.h:95
Definition: regguts.h:318
#define TTS_FLAG_EMPTY
Definition: tuptable.h:96
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:471
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
Definition: tuptable.h:427