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-2025, 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() */
75typedef void (*ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags);
77
78/* Hook for plugins to get control in ExecutorRun() */
79typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc,
80 ScanDirection direction,
81 uint64 count);
83
84/* Hook for plugins to get control in ExecutorFinish() */
85typedef void (*ExecutorFinish_hook_type) (QueryDesc *queryDesc);
87
88/* Hook for plugins to get control in ExecutorEnd() */
89typedef void (*ExecutorEnd_hook_type) (QueryDesc *queryDesc);
91
92/* Hook for plugins to get control in ExecCheckPermissions() */
93typedef bool (*ExecutorCheckPerms_hook_type) (List *rangeTable,
94 List *rtePermInfos,
95 bool ereport_on_violation);
97
98
99/*
100 * prototypes from functions in execAmi.c
101 */
102struct Path; /* avoid including pathnodes.h here */
103
104extern void ExecReScan(PlanState *node);
105extern void ExecMarkPos(PlanState *node);
106extern void ExecRestrPos(PlanState *node);
107extern bool ExecSupportsMarkRestore(struct Path *pathnode);
108extern bool ExecSupportsBackwardScan(Plan *node);
109extern bool ExecMaterializesOutput(NodeTag plantype);
110
111/*
112 * prototypes from functions in execCurrent.c
113 */
114extern bool execCurrentOf(CurrentOfExpr *cexpr,
115 ExprContext *econtext,
116 Oid table_oid,
117 ItemPointer current_tid);
118
119/*
120 * prototypes from functions in execGrouping.c
121 */
123 int numCols,
124 const AttrNumber *keyColIdx,
125 const Oid *eqOperators,
126 const Oid *collations,
127 PlanState *parent);
128extern void execTuplesHashPrepare(int numCols,
129 const Oid *eqOperators,
130 Oid **eqFuncOids,
131 FmgrInfo **hashFunctions);
133 TupleDesc inputDesc,
134 const TupleTableSlotOps *inputOps,
135 int numCols,
136 AttrNumber *keyColIdx,
137 const Oid *eqfuncoids,
138 FmgrInfo *hashfunctions,
139 Oid *collations,
140 long nbuckets,
141 Size additionalsize,
142 MemoryContext metacxt,
143 MemoryContext tablecxt,
144 MemoryContext tempcxt,
145 bool use_variable_hash_iv);
147 TupleTableSlot *slot,
148 bool *isnew, uint32 *hash);
150 TupleTableSlot *slot);
152 TupleTableSlot *slot,
153 bool *isnew, uint32 hash);
155 TupleTableSlot *slot,
156 ExprState *eqcomp,
157 ExprState *hashexpr);
158extern void ResetTupleHashTable(TupleHashTable hashtable);
159
160#ifndef FRONTEND
161/*
162 * Return size of the hash bucket. Useful for estimating memory usage.
163 */
164static inline size_t
166{
167 return sizeof(TupleHashEntryData);
168}
169
170/*
171 * Return tuple from hash entry.
172 */
173static inline MinimalTuple
175{
176 return entry->firstTuple;
177}
178
179/*
180 * Get a pointer into the additional space allocated for this entry. The
181 * memory will be maxaligned and zeroed.
182 *
183 * The amount of space available is the additionalsize requested in the call
184 * to BuildTupleHashTable(). If additionalsize was specified as zero, return
185 * NULL.
186 */
187static inline void *
189{
190 if (hashtable->additionalsize > 0)
191 return (char *) entry->firstTuple - hashtable->additionalsize;
192 else
193 return NULL;
194}
195#endif
196
197/*
198 * prototypes from functions in execJunk.c
199 */
200extern JunkFilter *ExecInitJunkFilter(List *targetList,
201 TupleTableSlot *slot);
203 TupleDesc cleanTupType,
204 TupleTableSlot *slot);
206 const char *attrName);
208 const char *attrName);
209extern TupleTableSlot *ExecFilterJunk(JunkFilter *junkfilter,
210 TupleTableSlot *slot);
211
212/*
213 * ExecGetJunkAttribute
214 *
215 * Given a junk filter's input tuple (slot) and a junk attribute's number
216 * previously found by ExecFindJunkAttribute, extract & return the value and
217 * isNull flag of the attribute.
218 */
219#ifndef FRONTEND
220static inline Datum
222{
223 Assert(attno > 0);
224 return slot_getattr(slot, attno, isNull);
225}
226#endif
227
228/*
229 * prototypes from functions in execMain.c
230 */
231extern void ExecutorStart(QueryDesc *queryDesc, int eflags);
232extern void standard_ExecutorStart(QueryDesc *queryDesc, int eflags);
233extern void ExecutorRun(QueryDesc *queryDesc,
234 ScanDirection direction, uint64 count);
235extern void standard_ExecutorRun(QueryDesc *queryDesc,
236 ScanDirection direction, uint64 count);
237extern void ExecutorFinish(QueryDesc *queryDesc);
238extern void standard_ExecutorFinish(QueryDesc *queryDesc);
239extern void ExecutorEnd(QueryDesc *queryDesc);
240extern void standard_ExecutorEnd(QueryDesc *queryDesc);
241extern void ExecutorRewind(QueryDesc *queryDesc);
242extern bool ExecCheckPermissions(List *rangeTable,
243 List *rteperminfos, bool ereport_on_violation);
244extern void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation,
245 List *mergeActions);
246extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
247 Relation resultRelationDesc,
248 Index resultRelationIndex,
249 ResultRelInfo *partition_root_rri,
250 int instrument_options);
251extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid,
252 ResultRelInfo *rootRelInfo);
253extern List *ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo);
254extern void ExecConstraints(ResultRelInfo *resultRelInfo,
255 TupleTableSlot *slot, EState *estate);
257 TupleTableSlot *slot,
258 EState *estate,
259 List *notnull_virtual_attrs);
260extern bool ExecPartitionCheck(ResultRelInfo *resultRelInfo,
261 TupleTableSlot *slot, EState *estate, bool emitError);
262extern void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo,
263 TupleTableSlot *slot, EState *estate);
264extern void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo,
265 TupleTableSlot *slot, EState *estate);
266extern char *ExecBuildSlotValueDescription(Oid reloid, TupleTableSlot *slot,
267 TupleDesc tupdesc,
268 Bitmapset *modifiedCols,
269 int maxfieldlen);
270extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
271extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
272extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
273extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation,
274 Index rti, TupleTableSlot *inputslot);
275extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate,
276 Plan *subplan, List *auxrowmarks,
277 int epqParam, List *resultRelations);
278extern void EvalPlanQualSetPlan(EPQState *epqstate,
279 Plan *subplan, List *auxrowmarks);
281 Relation relation, Index rti);
282
283#define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
284extern bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot);
285extern TupleTableSlot *EvalPlanQualNext(EPQState *epqstate);
286extern void EvalPlanQualBegin(EPQState *epqstate);
287extern void EvalPlanQualEnd(EPQState *epqstate);
288
289/*
290 * functions in execProcnode.c
291 */
292extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags);
294extern Node *MultiExecProcNode(PlanState *node);
295extern void ExecEndNode(PlanState *node);
296extern void ExecShutdownNode(PlanState *node);
297extern void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node);
298
299
300/* ----------------------------------------------------------------
301 * ExecProcNode
302 *
303 * Execute the given node to return a(nother) tuple.
304 * ----------------------------------------------------------------
305 */
306#ifndef FRONTEND
307static inline TupleTableSlot *
309{
310 if (node->chgParam != NULL) /* something changed? */
311 ExecReScan(node); /* let ReScan handle this */
312
313 return node->ExecProcNode(node);
314}
315#endif
316
317/*
318 * prototypes from functions in execExpr.c
319 */
320extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
321extern ExprState *ExecInitExprWithParams(Expr *node, ParamListInfo ext_params);
322extern ExprState *ExecInitQual(List *qual, PlanState *parent);
323extern ExprState *ExecInitCheck(List *qual, PlanState *parent);
324extern List *ExecInitExprList(List *nodes, PlanState *parent);
326 bool doSort, bool doHash, bool nullcheck);
328 const TupleTableSlotOps *ops,
329 FmgrInfo *hashfunctions,
330 Oid *collations,
331 int numCols,
332 AttrNumber *keyColIdx,
333 PlanState *parent,
334 uint32 init_value);
336 const TupleTableSlotOps *ops,
337 const Oid *hashfunc_oids,
338 const List *collations,
339 const List *hash_exprs,
340 const bool *opstrict, PlanState *parent,
341 uint32 init_value, bool keep_nulls);
343 const TupleTableSlotOps *lops, const TupleTableSlotOps *rops,
344 int numCols,
345 const AttrNumber *keyColIdx,
346 const Oid *eqfunctions,
347 const Oid *collations,
348 PlanState *parent);
350 const TupleTableSlotOps *lops,
351 const TupleTableSlotOps *rops,
352 const Oid *eqfunctions,
353 const Oid *collations,
354 const List *param_exprs,
355 PlanState *parent);
357 ExprContext *econtext,
358 TupleTableSlot *slot,
359 PlanState *parent,
360 TupleDesc inputDesc);
362 bool evalTargetList,
363 List *targetColnos,
364 TupleDesc relDesc,
365 ExprContext *econtext,
366 TupleTableSlot *slot,
367 PlanState *parent);
368extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
369extern ExprState *ExecPrepareQual(List *qual, EState *estate);
370extern ExprState *ExecPrepareCheck(List *qual, EState *estate);
371extern List *ExecPrepareExprList(List *nodes, EState *estate);
372
373/*
374 * ExecEvalExpr
375 *
376 * Evaluate expression identified by "state" in the execution context
377 * given by "econtext". *isNull is set to the is-null flag for the result,
378 * and the Datum value is the function result.
379 *
380 * The caller should already have switched into the temporary memory
381 * context econtext->ecxt_per_tuple_memory. The convenience entry point
382 * ExecEvalExprSwitchContext() is provided for callers who don't prefer to
383 * do the switch in an outer loop.
384 */
385#ifndef FRONTEND
386static inline Datum
388 ExprContext *econtext,
389 bool *isNull)
390{
391 return state->evalfunc(state, econtext, isNull);
392}
393#endif
394
395/*
396 * ExecEvalExprNoReturn
397 *
398 * Like ExecEvalExpr(), but for cases where no return value is expected,
399 * because the side-effects of expression evaluation are what's desired. This
400 * is e.g. used for projection and aggregate transition computation.
401
402 * Evaluate expression identified by "state" in the execution context
403 * given by "econtext".
404 *
405 * The caller should already have switched into the temporary memory context
406 * econtext->ecxt_per_tuple_memory. The convenience entry point
407 * ExecEvalExprNoReturnSwitchContext() is provided for callers who don't
408 * prefer to do the switch in an outer loop.
409 */
410#ifndef FRONTEND
411static inline void
413 ExprContext *econtext)
414{
416
417 retDatum = state->evalfunc(state, econtext, NULL);
418
419 Assert(retDatum == (Datum) 0);
420}
421#endif
422
423/*
424 * ExecEvalExprSwitchContext
425 *
426 * Same as ExecEvalExpr, but get into the right allocation context explicitly.
427 */
428#ifndef FRONTEND
429static inline Datum
431 ExprContext *econtext,
432 bool *isNull)
433{
434 Datum retDatum;
435 MemoryContext oldContext;
436
437 oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
438 retDatum = state->evalfunc(state, econtext, isNull);
439 MemoryContextSwitchTo(oldContext);
440 return retDatum;
441}
442#endif
443
444/*
445 * ExecEvalExprNoReturnSwitchContext
446 *
447 * Same as ExecEvalExprNoReturn, but get into the right allocation context
448 * explicitly.
449 */
450#ifndef FRONTEND
451static inline void
453 ExprContext *econtext)
454{
455 MemoryContext oldContext;
456
457 oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
458 ExecEvalExprNoReturn(state, econtext);
459 MemoryContextSwitchTo(oldContext);
460}
461#endif
462
463/*
464 * ExecProject
465 *
466 * Projects a tuple based on projection info and stores it in the slot passed
467 * to ExecBuildProjectionInfo().
468 *
469 * Note: the result is always a virtual tuple; therefore it may reference
470 * the contents of the exprContext's scan tuples and/or temporary results
471 * constructed in the exprContext. If the caller wishes the result to be
472 * valid longer than that data will be valid, he must call ExecMaterializeSlot
473 * on the result slot.
474 */
475#ifndef FRONTEND
476static inline TupleTableSlot *
478{
479 ExprContext *econtext = projInfo->pi_exprContext;
480 ExprState *state = &projInfo->pi_state;
481 TupleTableSlot *slot = state->resultslot;
482
483 /*
484 * Clear any former contents of the result slot. This makes it safe for
485 * us to use the slot's Datum/isnull arrays as workspace.
486 */
487 ExecClearTuple(slot);
488
489 /* Run the expression */
491
492 /*
493 * Successfully formed a result row. Mark the result slot as containing a
494 * valid virtual tuple (inlined version of ExecStoreVirtualTuple()).
495 */
496 slot->tts_flags &= ~TTS_FLAG_EMPTY;
497 slot->tts_nvalid = slot->tts_tupleDescriptor->natts;
498
499 return slot;
500}
501#endif
502
503/*
504 * ExecQual - evaluate a qual prepared with ExecInitQual (possibly via
505 * ExecPrepareQual). Returns true if qual is satisfied, else false.
506 *
507 * Note: ExecQual used to have a third argument "resultForNull". The
508 * behavior of this function now corresponds to resultForNull == false.
509 * If you want the resultForNull == true behavior, see ExecCheck.
510 */
511#ifndef FRONTEND
512static inline bool
514{
515 Datum ret;
516 bool isnull;
517
518 /* short-circuit (here and in ExecInitQual) for empty restriction list */
519 if (state == NULL)
520 return true;
521
522 /* verify that expression was compiled using ExecInitQual */
523 Assert(state->flags & EEO_FLAG_IS_QUAL);
524
525 ret = ExecEvalExprSwitchContext(state, econtext, &isnull);
526
527 /* EEOP_QUAL should never return NULL */
528 Assert(!isnull);
529
530 return DatumGetBool(ret);
531}
532#endif
533
534/*
535 * ExecQualAndReset() - evaluate qual with ExecQual() and reset expression
536 * context.
537 */
538#ifndef FRONTEND
539static inline bool
541{
542 bool ret = ExecQual(state, econtext);
543
544 /* inline ResetExprContext, to avoid ordering issue in this file */
546 return ret;
547}
548#endif
549
550extern bool ExecCheck(ExprState *state, ExprContext *econtext);
551
552/*
553 * prototypes from functions in execSRF.c
554 */
556 ExprContext *econtext, PlanState *parent);
558 ExprContext *econtext,
559 MemoryContext argContext,
560 TupleDesc expectedDesc,
561 bool randomAccess);
563 ExprContext *econtext, PlanState *parent);
565 ExprContext *econtext,
566 MemoryContext argContext,
567 bool *isNull,
568 ExprDoneCond *isDone);
569
570/*
571 * prototypes from functions in execScan.c
572 */
573typedef TupleTableSlot *(*ExecScanAccessMtd) (ScanState *node);
574typedef bool (*ExecScanRecheckMtd) (ScanState *node, TupleTableSlot *slot);
575
576extern TupleTableSlot *ExecScan(ScanState *node, ExecScanAccessMtd accessMtd,
577 ExecScanRecheckMtd recheckMtd);
578extern void ExecAssignScanProjectionInfo(ScanState *node);
579extern void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno);
580extern void ExecScanReScan(ScanState *node);
581
582/*
583 * prototypes from functions in execTuples.c
584 */
585extern void ExecInitResultTypeTL(PlanState *planstate);
586extern void ExecInitResultSlot(PlanState *planstate,
587 const TupleTableSlotOps *tts_ops);
588extern void ExecInitResultTupleSlotTL(PlanState *planstate,
589 const TupleTableSlotOps *tts_ops);
590extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate,
591 TupleDesc tupledesc,
592 const TupleTableSlotOps *tts_ops);
594 TupleDesc tupledesc,
595 const TupleTableSlotOps *tts_ops);
597 const TupleTableSlotOps *tts_ops);
598extern TupleDesc ExecTypeFromTL(List *targetList);
599extern TupleDesc ExecCleanTypeFromTL(List *targetList);
600extern TupleDesc ExecTypeFromExprList(List *exprList);
601extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList);
602extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
603
604typedef struct TupOutputState
605{
609
611 TupleDesc tupdesc,
612 const TupleTableSlotOps *tts_ops);
613extern void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull);
614extern void do_text_output_multiline(TupOutputState *tstate, const char *txt);
615extern void end_tup_output(TupOutputState *tstate);
616
617/*
618 * Write a single line of text given as a C string.
619 *
620 * Should only be used with a single-TEXT-attribute tupdesc.
621 */
622#define do_text_output_oneline(tstate, str_to_emit) \
623 do { \
624 Datum values_[1]; \
625 bool isnull_[1]; \
626 values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
627 isnull_[0] = false; \
628 do_tup_output(tstate, values_, isnull_); \
629 pfree(DatumGetPointer(values_[0])); \
630 } while (0)
631
632
633/*
634 * prototypes from functions in execUtils.c
635 */
636extern EState *CreateExecutorState(void);
637extern void FreeExecutorState(EState *estate);
638extern ExprContext *CreateExprContext(EState *estate);
641extern void FreeExprContext(ExprContext *econtext, bool isCommit);
642extern void ReScanExprContext(ExprContext *econtext);
643
644#define ResetExprContext(econtext) \
645 MemoryContextReset((econtext)->ecxt_per_tuple_memory)
646
648
649/* Get an EState's per-output-tuple exprcontext, making it if first use */
650#define GetPerTupleExprContext(estate) \
651 ((estate)->es_per_tuple_exprcontext ? \
652 (estate)->es_per_tuple_exprcontext : \
653 MakePerTupleExprContext(estate))
654
655#define GetPerTupleMemoryContext(estate) \
656 (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
657
658/* Reset an EState's per-output-tuple exprcontext, if one's been created */
659#define ResetPerTupleExprContext(estate) \
660 do { \
661 if ((estate)->es_per_tuple_exprcontext) \
662 ResetExprContext((estate)->es_per_tuple_exprcontext); \
663 } while (0)
664
665extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
666extern TupleDesc ExecGetResultType(PlanState *planstate);
667extern const TupleTableSlotOps *ExecGetResultSlotOps(PlanState *planstate,
668 bool *isfixed);
669extern const TupleTableSlotOps *ExecGetCommonSlotOps(PlanState **planstates,
670 int nplans);
672extern void ExecAssignProjectionInfo(PlanState *planstate,
673 TupleDesc inputDesc);
675 TupleDesc inputDesc, int varno);
676extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc);
677extern void ExecCreateScanSlotFromOuterPlan(EState *estate,
678 ScanState *scanstate,
679 const TupleTableSlotOps *tts_ops);
680
681extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
682
683extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
684
685extern void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos,
686 Bitmapset *unpruned_relids);
687extern void ExecCloseRangeTableRelations(EState *estate);
688extern void ExecCloseResultRelations(EState *estate);
689
690static inline RangeTblEntry *
692{
693 return (RangeTblEntry *) list_nth(estate->es_range_table, rti - 1);
694}
695
697 bool isResultRel);
698extern void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo,
699 Index rti);
700
701extern int executor_errposition(EState *estate, int location);
702
703extern void RegisterExprContextCallback(ExprContext *econtext,
705 Datum arg);
706extern void UnregisterExprContextCallback(ExprContext *econtext,
708 Datum arg);
709
710extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
711 bool *isNull);
713 bool *isNull);
714
715extern int ExecTargetListLength(List *targetlist);
716extern int ExecCleanTargetListLength(List *targetlist);
717
721extern TupleTableSlot *ExecGetAllNullSlot(EState *estate, ResultRelInfo *relInfo);
723extern TupleConversionMap *ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate);
724
725extern Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate);
726extern Bitmapset *ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate);
727extern Bitmapset *ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate);
728extern Bitmapset *ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate);
729extern Bitmapset *ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate);
730
731/*
732 * prototypes from functions in execIndexing.c
733 */
734extern void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative);
735extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
736extern List *ExecInsertIndexTuples(ResultRelInfo *resultRelInfo,
737 TupleTableSlot *slot, EState *estate,
738 bool update,
739 bool noDupErr,
740 bool *specConflict, List *arbiterIndexes,
741 bool onlySummarizing);
742extern bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo,
743 TupleTableSlot *slot,
744 EState *estate, ItemPointer conflictTid,
745 ItemPointer tupleid,
746 List *arbiterIndexes);
748 IndexInfo *indexInfo,
749 ItemPointer tupleid,
750 const Datum *values, const bool *isnull,
751 EState *estate, bool newIndex);
752
753/*
754 * prototypes from functions in execReplication.c
755 */
756extern bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid,
757 LockTupleMode lockmode,
758 TupleTableSlot *searchslot,
759 TupleTableSlot *outslot);
760extern bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode,
761 TupleTableSlot *searchslot, TupleTableSlot *outslot);
762
763extern void ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo,
764 EState *estate, TupleTableSlot *slot);
765extern void ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo,
766 EState *estate, EPQState *epqstate,
767 TupleTableSlot *searchslot, TupleTableSlot *slot);
768extern void ExecSimpleRelationDelete(ResultRelInfo *resultRelInfo,
769 EState *estate, EPQState *epqstate,
770 TupleTableSlot *searchslot);
771extern void CheckCmdReplicaIdentity(Relation rel, CmdType cmd);
772
773extern void CheckSubscriptionRelkind(char relkind, const char *nspname,
774 const char *relname);
775
776/*
777 * prototypes from functions in nodeModifyTable.c
778 */
780 TupleTableSlot *planSlot,
781 TupleTableSlot *oldSlot);
783 Oid resultoid,
784 bool missing_ok,
785 bool update_cache);
786
787#endif /* EXECUTOR_H */
int16 AttrNumber
Definition: attnum.h:21
static Datum values[MAXATTR]
Definition: bootstrap.c:151
#define PGDLLIMPORT
Definition: c.h:1291
#define PG_USED_FOR_ASSERTS_ONLY
Definition: c.h:224
int64_t int64
Definition: c.h:499
uint64_t uint64
Definition: c.h:503
uint32_t uint32
Definition: c.h:502
unsigned int Index
Definition: c.h:585
size_t Size
Definition: c.h:576
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:229
TupleTableSlot *(* ExecProcNodeMtd)(struct PlanState *pstate)
Definition: execnodes.h:1141
ExprDoneCond
Definition: execnodes.h:320
struct TupleHashEntryData TupleHashEntryData
#define EEO_FLAG_IS_QUAL
Definition: execnodes.h:76
static MinimalTuple TupleHashEntryGetTuple(TupleHashEntry entry)
Definition: executor.h:174
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:495
Relation ExecGetRangeTableRelation(EState *estate, Index rti, bool isResultRel)
Definition: execUtils.c:825
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:2502
ResultRelInfo * ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid, bool missing_ok, bool update_cache)
ExprState * execTuplesMatchPrepare(TupleDesc desc, int numCols, const AttrNumber *keyColIdx, const Oid *eqOperators, const Oid *collations, PlanState *parent)
Definition: execGrouping.c:58
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
Definition: execMain.c:2528
TupleConversionMap * ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate)
Definition: execUtils.c:1326
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
Definition: execMain.c:2551
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid, ResultRelInfo *rootRelInfo)
Definition: execMain.c:1326
void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation, List *mergeActions)
Definition: execMain.c:1048
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno)
Definition: execScan.c:94
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
Definition: execMain.c:71
TupleTableSlot * EvalPlanQualSlot(EPQState *epqstate, Relation relation, Index rti)
Definition: execMain.c:2749
Bitmapset * ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1403
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:2904
Bitmapset * ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1361
TupleTableSlot * ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1226
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
Definition: execMain.c:68
char * ExecBuildSlotValueDescription(Oid reloid, TupleTableSlot *slot, TupleDesc tupdesc, Bitmapset *modifiedCols, int maxfieldlen)
Definition: execMain.c:2363
ExprState * ExecBuildHash32FromAttrs(TupleDesc desc, const TupleTableSlotOps *ops, FmgrInfo *hashfunctions, Oid *collations, int numCols, AttrNumber *keyColIdx, PlanState *parent, uint32 init_value)
Definition: execExpr.c:4141
void ReScanExprContext(ExprContext *econtext)
Definition: execUtils.c:443
static TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
Definition: executor.h:477
bool ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool emitError)
Definition: execMain.c:1828
static void * TupleHashEntryGetAdditional(TupleHashTable hashtable, TupleHashEntry entry)
Definition: executor.h:188
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
Definition: execExpr.c:143
JunkFilter * ExecInitJunkFilterConversion(List *targetList, TupleDesc cleanTupType, TupleTableSlot *slot)
Definition: execJunk.c:137
void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull)
Definition: execTuples.c:2464
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
Definition: execExpr.c:765
bool ExecCheck(ExprState *state, ExprContext *econtext)
Definition: execExpr.c:872
ExprContext * CreateExprContext(EState *estate)
Definition: execUtils.c:307
ExprState * ExecInitCheck(List *qual, PlanState *parent)
Definition: execExpr.c:315
SetExprState * ExecInitFunctionResultSet(Expr *expr, ExprContext *econtext, PlanState *parent)
Definition: execSRF.c:444
void execTuplesHashPrepare(int numCols, const Oid *eqOperators, Oid **eqFuncOids, FmgrInfo **hashFunctions)
Definition: execGrouping.c:97
void(* ExecutorFinish_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:85
TupleConversionMap * ExecGetChildToRootMap(ResultRelInfo *resultRelInfo)
Definition: execUtils.c:1300
ExprContext * CreateStandaloneExprContext(void)
Definition: execUtils.c:357
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:2690
TupleTableSlot * ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1204
TupleDesc ExecCleanTypeFromTL(List *targetList)
Definition: execTuples.c:2139
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:2200
int executor_errposition(EState *estate, int location)
Definition: execUtils.c:936
void ExecInitResultSlot(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1968
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent, TupleDesc inputDesc)
Definition: execExpr.c:370
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
Definition: execTuples.c:2219
TupleHashEntry LookupTupleHashEntryHash(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 hash)
Definition: execGrouping.c:350
bool ExecSupportsMarkRestore(struct Path *pathnode)
Definition: execAmi.c:418
static RangeTblEntry * exec_rt_fetch(Index rti, EState *estate)
Definition: executor.h:691
Tuplestorestate * ExecMakeTableFunctionResult(SetExprState *setexpr, ExprContext *econtext, MemoryContext argContext, TupleDesc expectedDesc, bool randomAccess)
Definition: execSRF.c:101
Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno, bool *isNull)
Definition: execUtils.c:1124
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:416
void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos, Bitmapset *unpruned_relids)
Definition: execUtils.c:773
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
Definition: execJunk.c:247
Node * MultiExecProcNode(PlanState *node)
Definition: execProcnode.c:507
AttrNumber ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
Definition: execJunk.c:222
Bitmapset * ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1382
TupleTableSlot * ExecGetUpdateNewTuple(ResultRelInfo *relinfo, TupleTableSlot *planSlot, TupleTableSlot *oldSlot)
const TupleTableSlotOps * ExecGetCommonSlotOps(PlanState **planstates, int nplans)
Definition: execUtils.c:536
void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo, Index rti)
Definition: execUtils.c:880
void end_tup_output(TupOutputState *tstate)
Definition: execTuples.c:2522
void InitResultRelInfo(ResultRelInfo *resultRelInfo, Relation resultRelationDesc, Index resultRelationIndex, ResultRelInfo *partition_root_rri, int instrument_options)
Definition: execMain.c:1225
void ExecMarkPos(PlanState *node)
Definition: execAmi.c:327
void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node)
Definition: execProcnode.c:848
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
Definition: execScan.c:47
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:142
void ExecCreateScanSlotFromOuterPlan(EState *estate, ScanState *scanstate, const TupleTableSlotOps *tts_ops)
Definition: execUtils.c:704
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:407
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:562
JunkFilter * ExecInitJunkFilter(List *targetList, TupleTableSlot *slot)
Definition: execJunk.c:60
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:2000
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew, uint32 *hash)
Definition: execGrouping.c:295
void EvalPlanQualEnd(EPQState *epqstate)
Definition: execMain.c:3142
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1944
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
Definition: execMain.c:2732
void CheckCmdReplicaIdentity(Relation rel, CmdType cmd)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:142
ExprState * ExecBuildAggTrans(AggState *aggstate, struct AggStatePerPhaseData *phase, bool doSort, bool doHash, bool nullcheck)
void(* ExecutorRun_hook_type)(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: executor.h:79
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:70
void ExecutorRewind(QueryDesc *queryDesc)
Definition: execMain.c:537
void do_text_output_multiline(TupOutputState *tstate, const char *txt)
Definition: execTuples.c:2492
void ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:772
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Definition: execUtils.c:485
void ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:123
ExprState * ExecPrepareQual(List *qual, EState *estate)
Definition: execExpr.c:793
AttrNumber ExecRelGenVirtualNotNull(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, List *notnull_virtual_attrs)
Definition: execMain.c:2066
SetExprState * ExecInitTableFunctionResult(Expr *expr, ExprContext *econtext, PlanState *parent)
Definition: execSRF.c:56
ExprState * ExecInitQual(List *qual, PlanState *parent)
Definition: execExpr.c:229
TupleTableSlot * EvalPlanQual(EPQState *epqstate, Relation relation, Index rti, TupleTableSlot *inputslot)
Definition: execMain.c:2621
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:583
void(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
Definition: executor.h:75
static bool ExecQual(ExprState *state, ExprContext *econtext)
Definition: executor.h:513
ExprContext * MakePerTupleExprContext(EState *estate)
Definition: execUtils.c:458
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:989
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:692
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
Definition: executor.h:574
const TupleTableSlotOps * ExecGetCommonChildSlotOps(PlanState *ps)
Definition: execUtils.c:563
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:2020
bool(* ExecutorCheckPerms_hook_type)(List *rangeTable, List *rtePermInfos, bool ereport_on_violation)
Definition: executor.h:93
uint32 TupleHashTableHash(TupleHashTable hashtable, TupleTableSlot *slot)
Definition: execGrouping.c:327
bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
Definition: execMain.c:2777
List * ExecInitExprList(List *nodes, PlanState *parent)
Definition: execExpr.c:335
void ExecConditionalAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc, int varno)
Definition: execUtils.c:603
void(* ExecutorEnd_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:89
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1988
void ExecCloseIndices(ResultRelInfo *resultRelInfo)
Definition: execIndexing.c:238
void RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:963
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
Definition: executor.h:540
ExprState * ExecInitExprWithParams(Expr *node, ParamListInfo ext_params)
Definition: execExpr.c:180
void ExecAssignScanProjectionInfo(ScanState *node)
Definition: execScan.c:81
int ExecTargetListLength(List *targetlist)
Definition: execUtils.c:1175
ProjectionInfo * ExecBuildUpdateProjection(List *targetList, bool evalTargetList, List *targetColnos, TupleDesc relDesc, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent)
Definition: execExpr.c:547
void FreeExecutorState(EState *estate)
Definition: execUtils.c:192
struct TupOutputState TupOutputState
static size_t TupleHashEntrySize(void)
Definition: executor.h:165
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:729
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:4465
TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, ExprState *eqcomp, ExprState *hashexpr)
Definition: execGrouping.c:382
void ExecCloseResultRelations(EState *estate)
Definition: execMain.c:1547
static TupleTableSlot * ExecProcNode(PlanState *node)
Definition: executor.h:308
TupleTableSlot * ExecGetAllNullSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1273
bool ExecMaterializesOutput(NodeTag plantype)
Definition: execAmi.c:636
void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative)
Definition: execIndexing.c:160
int ExecCleanTargetListLength(List *targetlist)
Definition: execUtils.c:1185
ExprContext * CreateWorkExprContext(EState *estate)
Definition: execUtils.c:322
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:2444
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Definition: executor.h:573
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
Definition: execUtils.c:910
void ExecScanReScan(ScanState *node)
Definition: execScan.c:108
bool ExecSupportsBackwardScan(Plan *node)
Definition: execAmi.c:511
const TupleTableSlotOps * ExecGetResultSlotOps(PlanState *planstate, bool *isfixed)
Definition: execUtils.c:504
Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull)
Definition: execUtils.c:1061
TupleHashTable BuildTupleHashTable(PlanState *parent, TupleDesc inputDesc, const TupleTableSlotOps *inputOps, 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:161
PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
Definition: execMain.c:74
bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, ItemPointer conflictTid, ItemPointer tupleid, List *arbiterIndexes)
Definition: execIndexing.c:542
Bitmapset * ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1418
void ExecReScan(PlanState *node)
Definition: execAmi.c:77
static void ExecEvalExprNoReturn(ExprState *state, ExprContext *econtext)
Definition: executor.h:412
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
Definition: execMain.c:69
TupleDesc ExecTypeFromExprList(List *exprList)
Definition: execTuples.c:2186
List * ExecInsertIndexTuples(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool update, bool noDupErr, bool *specConflict, List *arbiterIndexes, bool onlySummarizing)
Definition: execIndexing.c:309
TupleDesc ExecTypeFromTL(List *targetList)
Definition: execTuples.c:2127
void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: execMain.c:308
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:387
bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid)
Definition: execCurrent.c:44
void ResetTupleHashTable(TupleHashTable hashtable)
Definition: execGrouping.c:274
List * ExecPrepareExprList(List *nodes, EState *estate)
Definition: execExpr.c:839
void standard_ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:476
void ExecRestrPos(PlanState *node)
Definition: execAmi.c:376
static void ExecEvalExprNoReturnSwitchContext(ExprState *state, ExprContext *econtext)
Definition: executor.h:452
void ExecCloseRangeTableRelations(EState *estate)
Definition: execMain.c:1607
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:430
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:956
void ExecSetExecProcNode(PlanState *node, ExecProcNodeMtd function)
Definition: execProcnode.c:430
void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1881
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:4624
void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:1952
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:2036
TupleTableSlot * ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1248
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:742
bool ExecCheckPermissions(List *rangeTable, List *rteperminfos, bool ereport_on_violation)
Definition: execMain.c:583
static Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
Definition: executor.h:221
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: execMain.c:298
Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate)
Definition: execUtils.c:1489
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:4300
EState * CreateExecutorState(void)
Definition: execUtils.c:88
ExprState * ExecPrepareCheck(List *qual, EState *estate)
Definition: execExpr.c:816
List * ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo)
Definition: execMain.c:1402
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
Definition: execMain.c:2888
void standard_ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:416
Assert(PointerIsAligned(start, uint64))
struct parser_state ps
LockTupleMode
Definition: lockoptions.h:50
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:383
CmdType
Definition: nodes.h:269
NodeTag
Definition: nodes.h:27
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:124
WCOKind
Definition: parsenodes.h:1372
NameData attname
Definition: pg_attribute.h:41
on_exit_nicely_callback function
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:95
uintptr_t Datum
Definition: postgres.h:69
unsigned int Oid
Definition: postgres_ext.h:30
static unsigned hash(unsigned *uv, int n)
Definition: rege_dfa.c:715
ScanDirection
Definition: sdir.h:25
List * es_range_table
Definition: execnodes.h:658
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:275
Definition: fmgr.h:57
Definition: pg_list.h:54
Definition: nodes.h:135
Bitmapset * chgParam
Definition: execnodes.h:1188
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1162
ExprState pi_state
Definition: execnodes.h:380
ExprContext * pi_exprContext
Definition: execnodes.h:382
TupleTableSlot * slot
Definition: executor.h:606
DestReceiver * dest
Definition: executor.h:607
MinimalTuple firstTuple
Definition: execnodes.h:845
TupleDesc tts_tupleDescriptor
Definition: tuptable.h:123
AttrNumber tts_nvalid
Definition: tuptable.h:120
uint16 tts_flags
Definition: tuptable.h:118
Definition: type.h:96
Definition: regguts.h:323
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
Definition: tuptable.h:399
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Definition: tuptable.h:458