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 char *ExecBuildSlotValueDescription(Oid reloid, TupleTableSlot *slot,
232  TupleDesc tupdesc,
233  Bitmapset *modifiedCols,
234  int maxfieldlen);
235 extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
236 extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
237 extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
238 extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation,
239  Index rti, TupleTableSlot *inputslot);
240 extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate,
241  Plan *subplan, List *auxrowmarks,
242  int epqParam, List *resultRelations);
243 extern void EvalPlanQualSetPlan(EPQState *epqstate,
244  Plan *subplan, List *auxrowmarks);
245 extern TupleTableSlot *EvalPlanQualSlot(EPQState *epqstate,
246  Relation relation, Index rti);
247 
248 #define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
249 extern bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot);
250 extern TupleTableSlot *EvalPlanQualNext(EPQState *epqstate);
251 extern void EvalPlanQualBegin(EPQState *epqstate);
252 extern void EvalPlanQualEnd(EPQState *epqstate);
253 
254 /*
255  * functions in execProcnode.c
256  */
257 extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags);
258 extern void ExecSetExecProcNode(PlanState *node, ExecProcNodeMtd function);
259 extern Node *MultiExecProcNode(PlanState *node);
260 extern void ExecEndNode(PlanState *node);
261 extern void ExecShutdownNode(PlanState *node);
262 extern void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node);
263 
264 
265 /* ----------------------------------------------------------------
266  * ExecProcNode
267  *
268  * Execute the given node to return a(nother) tuple.
269  * ----------------------------------------------------------------
270  */
271 #ifndef FRONTEND
272 static inline TupleTableSlot *
274 {
275  if (node->chgParam != NULL) /* something changed? */
276  ExecReScan(node); /* let ReScan handle this */
277 
278  return node->ExecProcNode(node);
279 }
280 #endif
281 
282 /*
283  * prototypes from functions in execExpr.c
284  */
285 extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
286 extern ExprState *ExecInitExprWithParams(Expr *node, ParamListInfo ext_params);
287 extern ExprState *ExecInitQual(List *qual, PlanState *parent);
288 extern ExprState *ExecInitCheck(List *qual, PlanState *parent);
289 extern List *ExecInitExprList(List *nodes, PlanState *parent);
290 extern ExprState *ExecBuildAggTrans(AggState *aggstate, struct AggStatePerPhaseData *phase,
291  bool doSort, bool doHash, bool nullcheck);
293  const TupleTableSlotOps *ops,
294  const Oid *hashfunc_oids,
295  const List *collations,
296  const List *hash_exprs,
297  const bool *opstrict, PlanState *parent,
298  uint32 init_value, bool keep_nulls);
300  const TupleTableSlotOps *lops, const TupleTableSlotOps *rops,
301  int numCols,
302  const AttrNumber *keyColIdx,
303  const Oid *eqfunctions,
304  const Oid *collations,
305  PlanState *parent);
307  const TupleTableSlotOps *lops,
308  const TupleTableSlotOps *rops,
309  const Oid *eqfunctions,
310  const Oid *collations,
311  const List *param_exprs,
312  PlanState *parent);
313 extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList,
314  ExprContext *econtext,
315  TupleTableSlot *slot,
316  PlanState *parent,
317  TupleDesc inputDesc);
318 extern ProjectionInfo *ExecBuildUpdateProjection(List *targetList,
319  bool evalTargetList,
320  List *targetColnos,
321  TupleDesc relDesc,
322  ExprContext *econtext,
323  TupleTableSlot *slot,
324  PlanState *parent);
325 extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
326 extern ExprState *ExecPrepareQual(List *qual, EState *estate);
327 extern ExprState *ExecPrepareCheck(List *qual, EState *estate);
328 extern List *ExecPrepareExprList(List *nodes, EState *estate);
329 
330 /*
331  * ExecEvalExpr
332  *
333  * Evaluate expression identified by "state" in the execution context
334  * given by "econtext". *isNull is set to the is-null flag for the result,
335  * and the Datum value is the function result.
336  *
337  * The caller should already have switched into the temporary memory
338  * context econtext->ecxt_per_tuple_memory. The convenience entry point
339  * ExecEvalExprSwitchContext() is provided for callers who don't prefer to
340  * do the switch in an outer loop.
341  */
342 #ifndef FRONTEND
343 static inline Datum
345  ExprContext *econtext,
346  bool *isNull)
347 {
348  return state->evalfunc(state, econtext, isNull);
349 }
350 #endif
351 
352 /*
353  * ExecEvalExprSwitchContext
354  *
355  * Same as ExecEvalExpr, but get into the right allocation context explicitly.
356  */
357 #ifndef FRONTEND
358 static inline Datum
360  ExprContext *econtext,
361  bool *isNull)
362 {
363  Datum retDatum;
364  MemoryContext oldContext;
365 
366  oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
367  retDatum = state->evalfunc(state, econtext, isNull);
368  MemoryContextSwitchTo(oldContext);
369  return retDatum;
370 }
371 #endif
372 
373 /*
374  * ExecProject
375  *
376  * Projects a tuple based on projection info and stores it in the slot passed
377  * to ExecBuildProjectionInfo().
378  *
379  * Note: the result is always a virtual tuple; therefore it may reference
380  * the contents of the exprContext's scan tuples and/or temporary results
381  * constructed in the exprContext. If the caller wishes the result to be
382  * valid longer than that data will be valid, he must call ExecMaterializeSlot
383  * on the result slot.
384  */
385 #ifndef FRONTEND
386 static inline TupleTableSlot *
388 {
389  ExprContext *econtext = projInfo->pi_exprContext;
390  ExprState *state = &projInfo->pi_state;
391  TupleTableSlot *slot = state->resultslot;
392  bool isnull;
393 
394  /*
395  * Clear any former contents of the result slot. This makes it safe for
396  * us to use the slot's Datum/isnull arrays as workspace.
397  */
398  ExecClearTuple(slot);
399 
400  /* Run the expression, discarding scalar result from the last column. */
401  (void) ExecEvalExprSwitchContext(state, econtext, &isnull);
402 
403  /*
404  * Successfully formed a result row. Mark the result slot as containing a
405  * valid virtual tuple (inlined version of ExecStoreVirtualTuple()).
406  */
407  slot->tts_flags &= ~TTS_FLAG_EMPTY;
408  slot->tts_nvalid = slot->tts_tupleDescriptor->natts;
409 
410  return slot;
411 }
412 #endif
413 
414 /*
415  * ExecQual - evaluate a qual prepared with ExecInitQual (possibly via
416  * ExecPrepareQual). Returns true if qual is satisfied, else false.
417  *
418  * Note: ExecQual used to have a third argument "resultForNull". The
419  * behavior of this function now corresponds to resultForNull == false.
420  * If you want the resultForNull == true behavior, see ExecCheck.
421  */
422 #ifndef FRONTEND
423 static inline bool
425 {
426  Datum ret;
427  bool isnull;
428 
429  /* short-circuit (here and in ExecInitQual) for empty restriction list */
430  if (state == NULL)
431  return true;
432 
433  /* verify that expression was compiled using ExecInitQual */
434  Assert(state->flags & EEO_FLAG_IS_QUAL);
435 
436  ret = ExecEvalExprSwitchContext(state, econtext, &isnull);
437 
438  /* EEOP_QUAL should never return NULL */
439  Assert(!isnull);
440 
441  return DatumGetBool(ret);
442 }
443 #endif
444 
445 /*
446  * ExecQualAndReset() - evaluate qual with ExecQual() and reset expression
447  * context.
448  */
449 #ifndef FRONTEND
450 static inline bool
452 {
453  bool ret = ExecQual(state, econtext);
454 
455  /* inline ResetExprContext, to avoid ordering issue in this file */
457  return ret;
458 }
459 #endif
460 
461 extern bool ExecCheck(ExprState *state, ExprContext *econtext);
462 
463 /*
464  * prototypes from functions in execSRF.c
465  */
467  ExprContext *econtext, PlanState *parent);
469  ExprContext *econtext,
470  MemoryContext argContext,
471  TupleDesc expectedDesc,
472  bool randomAccess);
474  ExprContext *econtext, PlanState *parent);
476  ExprContext *econtext,
477  MemoryContext argContext,
478  bool *isNull,
479  ExprDoneCond *isDone);
480 
481 /*
482  * prototypes from functions in execScan.c
483  */
484 typedef TupleTableSlot *(*ExecScanAccessMtd) (ScanState *node);
486 
487 extern TupleTableSlot *ExecScan(ScanState *node, ExecScanAccessMtd accessMtd,
488  ExecScanRecheckMtd recheckMtd);
489 extern void ExecAssignScanProjectionInfo(ScanState *node);
490 extern void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno);
491 extern void ExecScanReScan(ScanState *node);
492 
493 /*
494  * prototypes from functions in execTuples.c
495  */
496 extern void ExecInitResultTypeTL(PlanState *planstate);
497 extern void ExecInitResultSlot(PlanState *planstate,
498  const TupleTableSlotOps *tts_ops);
499 extern void ExecInitResultTupleSlotTL(PlanState *planstate,
500  const TupleTableSlotOps *tts_ops);
501 extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate,
502  TupleDesc tupledesc,
503  const TupleTableSlotOps *tts_ops);
505  TupleDesc tupledesc,
506  const TupleTableSlotOps *tts_ops);
507 extern TupleTableSlot *ExecInitNullTupleSlot(EState *estate, TupleDesc tupType,
508  const TupleTableSlotOps *tts_ops);
509 extern TupleDesc ExecTypeFromTL(List *targetList);
510 extern TupleDesc ExecCleanTypeFromTL(List *targetList);
511 extern TupleDesc ExecTypeFromExprList(List *exprList);
512 extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList);
513 extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
514 
515 typedef struct TupOutputState
516 {
520 
522  TupleDesc tupdesc,
523  const TupleTableSlotOps *tts_ops);
524 extern void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull);
525 extern void do_text_output_multiline(TupOutputState *tstate, const char *txt);
526 extern void end_tup_output(TupOutputState *tstate);
527 
528 /*
529  * Write a single line of text given as a C string.
530  *
531  * Should only be used with a single-TEXT-attribute tupdesc.
532  */
533 #define do_text_output_oneline(tstate, str_to_emit) \
534  do { \
535  Datum values_[1]; \
536  bool isnull_[1]; \
537  values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
538  isnull_[0] = false; \
539  do_tup_output(tstate, values_, isnull_); \
540  pfree(DatumGetPointer(values_[0])); \
541  } while (0)
542 
543 
544 /*
545  * prototypes from functions in execUtils.c
546  */
547 extern EState *CreateExecutorState(void);
548 extern void FreeExecutorState(EState *estate);
549 extern ExprContext *CreateExprContext(EState *estate);
550 extern ExprContext *CreateWorkExprContext(EState *estate);
552 extern void FreeExprContext(ExprContext *econtext, bool isCommit);
553 extern void ReScanExprContext(ExprContext *econtext);
554 
555 #define ResetExprContext(econtext) \
556  MemoryContextReset((econtext)->ecxt_per_tuple_memory)
557 
559 
560 /* Get an EState's per-output-tuple exprcontext, making it if first use */
561 #define GetPerTupleExprContext(estate) \
562  ((estate)->es_per_tuple_exprcontext ? \
563  (estate)->es_per_tuple_exprcontext : \
564  MakePerTupleExprContext(estate))
565 
566 #define GetPerTupleMemoryContext(estate) \
567  (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
568 
569 /* Reset an EState's per-output-tuple exprcontext, if one's been created */
570 #define ResetPerTupleExprContext(estate) \
571  do { \
572  if ((estate)->es_per_tuple_exprcontext) \
573  ResetExprContext((estate)->es_per_tuple_exprcontext); \
574  } while (0)
575 
576 extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
577 extern TupleDesc ExecGetResultType(PlanState *planstate);
578 extern const TupleTableSlotOps *ExecGetResultSlotOps(PlanState *planstate,
579  bool *isfixed);
580 extern void ExecAssignProjectionInfo(PlanState *planstate,
581  TupleDesc inputDesc);
582 extern void ExecConditionalAssignProjectionInfo(PlanState *planstate,
583  TupleDesc inputDesc, int varno);
584 extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc);
585 extern void ExecCreateScanSlotFromOuterPlan(EState *estate,
586  ScanState *scanstate,
587  const TupleTableSlotOps *tts_ops);
588 
589 extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
590 
591 extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
592 
593 extern void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos);
594 extern void ExecCloseRangeTableRelations(EState *estate);
595 extern void ExecCloseResultRelations(EState *estate);
596 
597 static inline RangeTblEntry *
599 {
600  return (RangeTblEntry *) list_nth(estate->es_range_table, rti - 1);
601 }
602 
603 extern Relation ExecGetRangeTableRelation(EState *estate, Index rti);
604 extern void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo,
605  Index rti);
606 
607 extern int executor_errposition(EState *estate, int location);
608 
609 extern void RegisterExprContextCallback(ExprContext *econtext,
611  Datum arg);
612 extern void UnregisterExprContextCallback(ExprContext *econtext,
614  Datum arg);
615 
616 extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
617  bool *isNull);
619  bool *isNull);
620 
621 extern int ExecTargetListLength(List *targetlist);
622 extern int ExecCleanTargetListLength(List *targetlist);
623 
624 extern TupleTableSlot *ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo);
625 extern TupleTableSlot *ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo);
626 extern TupleTableSlot *ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo);
628 extern TupleConversionMap *ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate);
629 
630 extern Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate);
631 extern Bitmapset *ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate);
632 extern Bitmapset *ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate);
633 extern Bitmapset *ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate);
634 extern Bitmapset *ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate);
635 
636 /*
637  * prototypes from functions in execIndexing.c
638  */
639 extern void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative);
640 extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
641 extern List *ExecInsertIndexTuples(ResultRelInfo *resultRelInfo,
642  TupleTableSlot *slot, EState *estate,
643  bool update,
644  bool noDupErr,
645  bool *specConflict, List *arbiterIndexes,
646  bool onlySummarizing);
647 extern bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo,
648  TupleTableSlot *slot,
649  EState *estate, ItemPointer conflictTid,
650  ItemPointer tupleid,
651  List *arbiterIndexes);
653  IndexInfo *indexInfo,
654  ItemPointer tupleid,
655  const Datum *values, const bool *isnull,
656  EState *estate, bool newIndex);
657 
658 /*
659  * prototypes from functions in execReplication.c
660  */
662 extern bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid,
663  LockTupleMode lockmode,
664  TupleTableSlot *searchslot,
665  TupleTableSlot *outslot);
666 extern bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode,
667  TupleTableSlot *searchslot, TupleTableSlot *outslot);
668 
669 extern void ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo,
670  EState *estate, TupleTableSlot *slot);
671 extern void ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo,
672  EState *estate, EPQState *epqstate,
673  TupleTableSlot *searchslot, TupleTableSlot *slot);
674 extern void ExecSimpleRelationDelete(ResultRelInfo *resultRelInfo,
675  EState *estate, EPQState *epqstate,
676  TupleTableSlot *searchslot);
677 extern void CheckCmdReplicaIdentity(Relation rel, CmdType cmd);
678 
679 extern void CheckSubscriptionRelkind(char relkind, const char *nspname,
680  const char *relname);
681 
682 /*
683  * prototypes from functions in nodeModifyTable.c
684  */
686  TupleTableSlot *planSlot,
687  TupleTableSlot *oldSlot);
689  Oid resultoid,
690  bool missing_ok,
691  bool update_cache);
692 
693 #endif /* EXECUTOR_H */
int16 AttrNumber
Definition: attnum.h:21
static Datum values[MAXATTR]
Definition: bootstrap.c:150
unsigned int uint32
Definition: c.h:509
#define PGDLLIMPORT
Definition: c.h:1319
#define Assert(condition)
Definition: c.h:861
unsigned char bool
Definition: c.h:459
unsigned int Index
Definition: c.h:617
size_t Size
Definition: c.h:608
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:220
TupleTableSlot *(* ExecProcNodeMtd)(struct PlanState *pstate)
Definition: execnodes.h:1113
ExprDoneCond
Definition: execnodes.h:305
#define EEO_FLAG_IS_QUAL
Definition: execnodes.h:76
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:495
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:2355
Bitmapset * ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1326
ExprState * ExecBuildAggTrans(AggState *aggstate, struct AggStatePerPhaseData *phase, bool doSort, bool doHash, bool nullcheck)
void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation, List *mergeActions)
Definition: execMain.c:1024
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno)
Definition: execScan.c:283
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
Definition: execMain.c:69
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:2755
TupleTableSlot * EvalPlanQual(EPQState *epqstate, Relation relation, Index rti, TupleTableSlot *inputslot)
Definition: execMain.c:2474
TupleTableSlot * ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1140
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
Definition: execExpr.c:743
StrategyNumber get_equal_strategy_number_for_am(Oid am)
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
Definition: execMain.c:66
void ReScanExprContext(ExprContext *econtext)
Definition: execUtils.c:443
ExprContext * CreateWorkExprContext(EState *estate)
Definition: execUtils.c:321
bool ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool emitError)
Definition: execMain.c:1796
void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull)
Definition: execTuples.c:2362
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:850
JunkFilter * ExecInitJunkFilter(List *targetList, TupleTableSlot *slot)
Definition: execJunk.c:60
const TupleTableSlotOps * ExecGetResultSlotOps(PlanState *planstate, bool *isfixed)
Definition: execUtils.c:504
Bitmapset * ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1290
ExprState * ExecInitExprWithParams(Expr *node, ParamListInfo ext_params)
Definition: execExpr.c:175
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:97
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:598
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
Definition: execMain.c:2739
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:256
List * ExecInitExprList(List *nodes, PlanState *parent)
Definition: execExpr.c:330
void ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:465
void EvalPlanQualInit(EPQState *epqstate, EState *parentestate, Plan *subplan, List *auxrowmarks, int epqParam, List *resultRelations)
Definition: execMain.c:2543
void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos)
Definition: execUtils.c:730
TupleTableSlot * ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1184
TupleDesc ExecCleanTypeFromTL(List *targetList)
Definition: execTuples.c:2037
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:2055
int executor_errposition(EState *estate, int location)
Definition: execUtils.c:872
ProjectionInfo * ExecBuildUpdateProjection(List *targetList, bool evalTargetList, List *targetColnos, TupleDesc relDesc, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent)
Definition: execExpr.c:525
void ExecInitResultSlot(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1866
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1934
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
Definition: execTuples.c:2117
TupleHashEntry LookupTupleHashEntryHash(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 hash)
Definition: execGrouping.c:362
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:1060
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:416
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:224
AttrNumber ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
Definition: execJunk.c:222
void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo, Index rti)
Definition: execUtils.c:816
void end_tup_output(TupOutputState *tstate)
Definition: execTuples.c:2420
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:1201
void ExecMarkPos(PlanState *node)
Definition: execAmi.c:326
ExprState * ExecPrepareCheck(List *qual, EState *estate)
Definition: execExpr.c:794
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
Definition: execMain.c:2404
static TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
Definition: executor.h:387
void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node)
Definition: execProcnode.c:848
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:139
ExprContext * CreateStandaloneExprContext(void)
Definition: execUtils.c:357
void ExecCreateScanSlotFromOuterPlan(EState *estate, ScanState *scanstate, const TupleTableSlotOps *tts_ops)
Definition: execUtils.c:661
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:405
EState * CreateExecutorState(void)
Definition: execUtils.c:88
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:562
ExprContext * CreateExprContext(EState *estate)
Definition: execUtils.c:306
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:1898
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 *hash)
Definition: execGrouping.c:307
void EvalPlanQualEnd(EPQState *epqstate)
Definition: execMain.c:2986
SetExprState * ExecInitFunctionResultSet(Expr *expr, ExprContext *econtext, PlanState *parent)
Definition: execSRF.c:444
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1842
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
Definition: execMain.c:2585
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:68
void ExecutorRewind(QueryDesc *queryDesc)
Definition: execMain.c:531
void do_text_output_multiline(TupOutputState *tstate, const char *txt)
Definition: execTuples.c:2390
void ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:772
TupleTableSlot * ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1162
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:485
void ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:120
Relation ExecGetRangeTableRelation(EState *estate, Index rti)
Definition: execUtils.c:764
char * ExecBuildSlotValueDescription(Oid reloid, TupleTableSlot *slot, TupleDesc tupdesc, Bitmapset *modifiedCols, int maxfieldlen)
Definition: execMain.c:2218
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Definition: executor.h:484
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:540
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1918
void(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
Definition: executor.h:75
static bool ExecQual(ExprState *state, ExprContext *econtext)
Definition: executor.h:424
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
Definition: execJunk.c:247
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:925
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:649
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
Definition: executor.h:485
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:138
uint32 TupleHashTableHash(TupleHashTable hashtable, TupleTableSlot *slot)
Definition: execGrouping.c:339
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:306
bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
Definition: execMain.c:2630
void ExecConditionalAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc, int varno)
Definition: execUtils.c:560
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:507
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1886
ExprState * ExecInitCheck(List *qual, PlanState *parent)
Definition: execExpr.c:310
void ExecCloseIndices(ResultRelInfo *resultRelInfo)
Definition: execIndexing.c:236
void RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:899
List * ExecInsertIndexTuples(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool update, bool noDupErr, bool *specConflict, List *arbiterIndexes, bool onlySummarizing)
Definition: execIndexing.c:303
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
Definition: executor.h:451
TupleConversionMap * ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate)
Definition: execUtils.c:1234
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:270
int ExecTargetListLength(List *targetlist)
Definition: execUtils.c:1111
void FreeExecutorState(EState *estate)
Definition: execUtils.c:191
struct TupOutputState TupOutputState
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:686
void ExecCloseResultRelations(EState *estate)
Definition: execMain.c:1521
ExprState * ExecPrepareQual(List *qual, EState *estate)
Definition: execExpr.c:771
TupleConversionMap * ExecGetChildToRootMap(ResultRelInfo *resultRelInfo)
Definition: execUtils.c:1208
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
Definition: execMain.c:2381
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent, TupleDesc inputDesc)
Definition: execExpr.c:365
bool ExecMaterializesOutput(NodeTag plantype)
Definition: execAmi.c:635
List * ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo)
Definition: execMain.c:1376
void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative)
Definition: execIndexing.c:160
int ExecCleanTargetListLength(List *targetlist)
Definition: execUtils.c:1121
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
Definition: execUtils.c:846
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:997
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:4125
PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
Definition: execMain.c:72
bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, ItemPointer tupleid, List *arbiterIndexes)
Definition: execIndexing.c:536
TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, ExprState *eqcomp, FmgrInfo *hashfunctions)
Definition: execGrouping.c:394
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:155
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:2342
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
Definition: execMain.c:67
List * ExecPrepareExprList(List *nodes, EState *estate)
Definition: execExpr.c:817
ExprContext * MakePerTupleExprContext(EState *estate)
Definition: execUtils.c:458
TupleDesc ExecTypeFromExprList(List *exprList)
Definition: execTuples.c:2084
TupleDesc ExecTypeFromTL(List *targetList)
Definition: execTuples.c:2025
TupleTableSlot * EvalPlanQualSlot(EPQState *epqstate, Relation relation, Index rti)
Definition: execMain.c:2602
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:344
Bitmapset * ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1311
bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid)
Definition: execCurrent.c:44
void ResetTupleHashTable(TupleHashTable hashtable)
Definition: execGrouping.c:286
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:295
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid, ResultRelInfo *rootRelInfo)
Definition: execMain.c:1300
void standard_ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:474
ExprState * ExecBuildHash32Expr(TupleDesc desc, const TupleTableSlotOps *ops, const Oid *hashfunc_oids, const List *collations, const List *hash_exprs, const bool *opstrict, PlanState *parent, uint32 init_value, bool keep_nulls)
Definition: execExpr.c:3992
void ExecRestrPos(PlanState *node)
Definition: execAmi.c:375
void ExecCloseRangeTableRelations(EState *estate)
Definition: execMain.c:1581
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:359
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:950
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:430
void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1849
Bitmapset * ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1269
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1920
JunkFilter * ExecInitJunkFilterConversion(List *targetList, TupleDesc cleanTupType, TupleTableSlot *slot)
Definition: execJunk.c:137
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:699
bool ExecCheckPermissions(List *rangeTable, List *rteperminfos, bool ereport_on_violation)
Definition: execMain.c:577
static Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
Definition: executor.h:190
Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate)
Definition: execUtils.c:1397
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:4282
static TupleTableSlot * ExecProcNode(PlanState *node)
Definition: executor.h:273
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:142
void standard_ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:414
LockTupleMode
Definition: lockoptions.h:50
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:383
CmdType
Definition: nodes.h:263
NodeTag
Definition: nodes.h:27
WCOKind
Definition: parsenodes.h:1358
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
MemoryContextSwitchTo(old_ctx)
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:634
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:266
Definition: fmgr.h:57
Definition: pg_list.h:54
Definition: nodes.h:129
Bitmapset * chgParam
Definition: execnodes.h:1160
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1134
ExprState pi_state
Definition: execnodes.h:365
ExprContext * pi_exprContext
Definition: execnodes.h:367
TupleTableSlot * slot
Definition: executor.h:517
DestReceiver * dest
Definition: executor.h:518
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:454
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
Definition: tuptable.h:395