PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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#include "utils/plancache.h"
23
24
25/*
26 * The "eflags" argument to ExecutorStart and the various ExecInitNode
27 * routines is a bitwise OR of the following flag bits, which tell the
28 * called plan node what to expect. Note that the flags will get modified
29 * as they are passed down the plan tree, since an upper node may require
30 * functionality in its subnode not demanded of the plan as a whole
31 * (example: MergeJoin requires mark/restore capability in its inner input),
32 * or an upper node may shield its input from some functionality requirement
33 * (example: Materialize shields its input from needing to do backward scan).
34 *
35 * EXPLAIN_ONLY indicates that the plan tree is being initialized just so
36 * EXPLAIN can print it out; it will not be run. Hence, no side-effects
37 * of startup should occur. However, error checks (such as permission checks)
38 * should be performed.
39 *
40 * EXPLAIN_GENERIC can only be used together with EXPLAIN_ONLY. It indicates
41 * that a generic plan is being shown using EXPLAIN (GENERIC_PLAN), which
42 * means that missing parameter values must be tolerated. Currently, the only
43 * effect is to suppress execution-time partition pruning.
44 *
45 * REWIND indicates that the plan node should try to efficiently support
46 * rescans without parameter changes. (Nodes must support ExecReScan calls
47 * in any case, but if this flag was not given, they are at liberty to do it
48 * through complete recalculation. Note that a parameter change forces a
49 * full recalculation in any case.)
50 *
51 * BACKWARD indicates that the plan node must respect the es_direction flag.
52 * When this is not passed, the plan node will only be run forwards.
53 *
54 * MARK indicates that the plan node must support Mark/Restore calls.
55 * When this is not passed, no Mark/Restore will occur.
56 *
57 * SKIP_TRIGGERS tells ExecutorStart/ExecutorFinish to skip calling
58 * AfterTriggerBeginQuery/AfterTriggerEndQuery. This does not necessarily
59 * mean that the plan can't queue any AFTER triggers; just that the caller
60 * is responsible for there being a trigger context for them to be queued in.
61 *
62 * WITH_NO_DATA indicates that we are performing REFRESH MATERIALIZED VIEW
63 * ... WITH NO DATA. Currently, the only effect is to suppress errors about
64 * scanning unpopulated materialized views.
65 */
66#define EXEC_FLAG_EXPLAIN_ONLY 0x0001 /* EXPLAIN, no ANALYZE */
67#define EXEC_FLAG_EXPLAIN_GENERIC 0x0002 /* EXPLAIN (GENERIC_PLAN) */
68#define EXEC_FLAG_REWIND 0x0004 /* need efficient rescan */
69#define EXEC_FLAG_BACKWARD 0x0008 /* need backward scan */
70#define EXEC_FLAG_MARK 0x0010 /* need mark/restore */
71#define EXEC_FLAG_SKIP_TRIGGERS 0x0020 /* skip AfterTrigger setup */
72#define EXEC_FLAG_WITH_NO_DATA 0x0040 /* REFRESH ... WITH NO DATA */
73
74
75/* Hook for plugins to get control in ExecutorStart() */
76typedef bool (*ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags);
78
79/* Hook for plugins to get control in ExecutorRun() */
80typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc,
81 ScanDirection direction,
82 uint64 count);
84
85/* Hook for plugins to get control in ExecutorFinish() */
86typedef void (*ExecutorFinish_hook_type) (QueryDesc *queryDesc);
88
89/* Hook for plugins to get control in ExecutorEnd() */
90typedef void (*ExecutorEnd_hook_type) (QueryDesc *queryDesc);
92
93/* Hook for plugins to get control in ExecCheckPermissions() */
94typedef 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 */
103struct Path; /* avoid including pathnodes.h here */
104
105extern void ExecReScan(PlanState *node);
106extern void ExecMarkPos(PlanState *node);
107extern void ExecRestrPos(PlanState *node);
108extern bool ExecSupportsMarkRestore(struct Path *pathnode);
109extern bool ExecSupportsBackwardScan(Plan *node);
110extern bool ExecMaterializesOutput(NodeTag plantype);
111
112/*
113 * prototypes from functions in execCurrent.c
114 */
115extern 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);
129extern void execTuplesHashPrepare(int numCols,
130 const Oid *eqOperators,
131 Oid **eqFuncOids,
132 FmgrInfo **hashFunctions);
134 TupleDesc inputDesc,
135 const TupleTableSlotOps *inputOps,
136 int numCols,
137 AttrNumber *keyColIdx,
138 const Oid *eqfuncoids,
139 FmgrInfo *hashfunctions,
140 Oid *collations,
141 long nbuckets,
142 Size additionalsize,
143 MemoryContext metacxt,
144 MemoryContext tablecxt,
145 MemoryContext tempcxt,
146 bool use_variable_hash_iv);
148 TupleTableSlot *slot,
149 bool *isnew, uint32 *hash);
151 TupleTableSlot *slot);
153 TupleTableSlot *slot,
154 bool *isnew, uint32 hash);
156 TupleTableSlot *slot,
157 ExprState *eqcomp,
158 ExprState *hashexpr);
159extern void ResetTupleHashTable(TupleHashTable hashtable);
160
161#ifndef FRONTEND
162/*
163 * Return size of the hash bucket. Useful for estimating memory usage.
164 */
165static inline size_t
167{
168 return sizeof(TupleHashEntryData);
169}
170
171/*
172 * Return tuple from hash entry.
173 */
174static inline MinimalTuple
176{
177 return entry->firstTuple;
178}
179
180/*
181 * Get a pointer into the additional space allocated for this entry. The
182 * memory will be maxaligned and zeroed.
183 *
184 * The amount of space available is the additionalsize requested in the call
185 * to BuildTupleHashTable(). If additionalsize was specified as zero, return
186 * NULL.
187 */
188static inline void *
190{
191 if (hashtable->additionalsize > 0)
192 return (char *) entry->firstTuple - hashtable->additionalsize;
193 else
194 return NULL;
195}
196#endif
197
198/*
199 * prototypes from functions in execJunk.c
200 */
201extern JunkFilter *ExecInitJunkFilter(List *targetList,
202 TupleTableSlot *slot);
204 TupleDesc cleanTupType,
205 TupleTableSlot *slot);
207 const char *attrName);
209 const char *attrName);
210extern TupleTableSlot *ExecFilterJunk(JunkFilter *junkfilter,
211 TupleTableSlot *slot);
212
213/*
214 * ExecGetJunkAttribute
215 *
216 * Given a junk filter's input tuple (slot) and a junk attribute's number
217 * previously found by ExecFindJunkAttribute, extract & return the value and
218 * isNull flag of the attribute.
219 */
220#ifndef FRONTEND
221static inline Datum
223{
224 Assert(attno > 0);
225 return slot_getattr(slot, attno, isNull);
226}
227#endif
228
229/*
230 * prototypes from functions in execMain.c
231 */
232extern bool ExecutorStart(QueryDesc *queryDesc, int eflags);
233extern void ExecutorStartCachedPlan(QueryDesc *queryDesc, int eflags,
234 CachedPlanSource *plansource,
235 int query_index);
236extern bool standard_ExecutorStart(QueryDesc *queryDesc, int eflags);
237extern void ExecutorRun(QueryDesc *queryDesc,
238 ScanDirection direction, uint64 count);
239extern void standard_ExecutorRun(QueryDesc *queryDesc,
240 ScanDirection direction, uint64 count);
241extern void ExecutorFinish(QueryDesc *queryDesc);
242extern void standard_ExecutorFinish(QueryDesc *queryDesc);
243extern void ExecutorEnd(QueryDesc *queryDesc);
244extern void standard_ExecutorEnd(QueryDesc *queryDesc);
245extern void ExecutorRewind(QueryDesc *queryDesc);
246extern bool ExecCheckPermissions(List *rangeTable,
247 List *rteperminfos, bool ereport_on_violation);
248extern void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation,
249 List *mergeActions);
250extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
251 Relation resultRelationDesc,
252 Index resultRelationIndex,
253 ResultRelInfo *partition_root_rri,
254 int instrument_options);
255extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid,
256 ResultRelInfo *rootRelInfo);
257extern List *ExecGetAncestorResultRels(EState *estate, ResultRelInfo *resultRelInfo);
258extern void ExecConstraints(ResultRelInfo *resultRelInfo,
259 TupleTableSlot *slot, EState *estate);
261 TupleTableSlot *slot,
262 EState *estate,
263 List *notnull_virtual_attrs);
264extern bool ExecPartitionCheck(ResultRelInfo *resultRelInfo,
265 TupleTableSlot *slot, EState *estate, bool emitError);
266extern void ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo,
267 TupleTableSlot *slot, EState *estate);
268extern void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo,
269 TupleTableSlot *slot, EState *estate);
270extern char *ExecBuildSlotValueDescription(Oid reloid, TupleTableSlot *slot,
271 TupleDesc tupdesc,
272 Bitmapset *modifiedCols,
273 int maxfieldlen);
274extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
275extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
276extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
277extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation,
278 Index rti, TupleTableSlot *inputslot);
279extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate,
280 Plan *subplan, List *auxrowmarks,
281 int epqParam, List *resultRelations);
282extern void EvalPlanQualSetPlan(EPQState *epqstate,
283 Plan *subplan, List *auxrowmarks);
285 Relation relation, Index rti);
286
287#define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot))
288extern bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot);
289extern TupleTableSlot *EvalPlanQualNext(EPQState *epqstate);
290extern void EvalPlanQualBegin(EPQState *epqstate);
291extern void EvalPlanQualEnd(EPQState *epqstate);
292
293/*
294 * functions in execProcnode.c
295 */
296extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags);
298extern Node *MultiExecProcNode(PlanState *node);
299extern void ExecEndNode(PlanState *node);
300extern void ExecShutdownNode(PlanState *node);
301extern void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node);
302
303/*
304 * Is the CachedPlan in es_cachedplan still valid?
305 *
306 * Called from InitPlan() because invalidation messages that affect the plan
307 * might be received after locks have been taken on runtime-prunable relations.
308 * The caller should take appropriate action if the plan has become invalid.
309 */
310static inline bool
312{
313 return estate->es_cachedplan == NULL ? true :
315}
316
317/*
318 * Locks are needed only if running a cached plan that might contain unlocked
319 * relations, such as a reused generic plan.
320 */
321static inline bool
323{
324 return estate->es_cachedplan == NULL ? false :
326}
327
328/* ----------------------------------------------------------------
329 * ExecProcNode
330 *
331 * Execute the given node to return a(nother) tuple.
332 * ----------------------------------------------------------------
333 */
334#ifndef FRONTEND
335static inline TupleTableSlot *
337{
338 if (node->chgParam != NULL) /* something changed? */
339 ExecReScan(node); /* let ReScan handle this */
340
341 return node->ExecProcNode(node);
342}
343#endif
344
345/*
346 * prototypes from functions in execExpr.c
347 */
348extern ExprState *ExecInitExpr(Expr *node, PlanState *parent);
349extern ExprState *ExecInitExprWithParams(Expr *node, ParamListInfo ext_params);
350extern ExprState *ExecInitQual(List *qual, PlanState *parent);
351extern ExprState *ExecInitCheck(List *qual, PlanState *parent);
352extern List *ExecInitExprList(List *nodes, PlanState *parent);
354 bool doSort, bool doHash, bool nullcheck);
356 const TupleTableSlotOps *ops,
357 FmgrInfo *hashfunctions,
358 Oid *collations,
359 int numCols,
360 AttrNumber *keyColIdx,
361 PlanState *parent,
362 uint32 init_value);
364 const TupleTableSlotOps *ops,
365 const Oid *hashfunc_oids,
366 const List *collations,
367 const List *hash_exprs,
368 const bool *opstrict, PlanState *parent,
369 uint32 init_value, bool keep_nulls);
371 const TupleTableSlotOps *lops, const TupleTableSlotOps *rops,
372 int numCols,
373 const AttrNumber *keyColIdx,
374 const Oid *eqfunctions,
375 const Oid *collations,
376 PlanState *parent);
378 const TupleTableSlotOps *lops,
379 const TupleTableSlotOps *rops,
380 const Oid *eqfunctions,
381 const Oid *collations,
382 const List *param_exprs,
383 PlanState *parent);
385 ExprContext *econtext,
386 TupleTableSlot *slot,
387 PlanState *parent,
388 TupleDesc inputDesc);
390 bool evalTargetList,
391 List *targetColnos,
392 TupleDesc relDesc,
393 ExprContext *econtext,
394 TupleTableSlot *slot,
395 PlanState *parent);
396extern ExprState *ExecPrepareExpr(Expr *node, EState *estate);
397extern ExprState *ExecPrepareQual(List *qual, EState *estate);
398extern ExprState *ExecPrepareCheck(List *qual, EState *estate);
399extern List *ExecPrepareExprList(List *nodes, EState *estate);
400
401/*
402 * ExecEvalExpr
403 *
404 * Evaluate expression identified by "state" in the execution context
405 * given by "econtext". *isNull is set to the is-null flag for the result,
406 * and the Datum value is the function result.
407 *
408 * The caller should already have switched into the temporary memory
409 * context econtext->ecxt_per_tuple_memory. The convenience entry point
410 * ExecEvalExprSwitchContext() is provided for callers who don't prefer to
411 * do the switch in an outer loop.
412 */
413#ifndef FRONTEND
414static inline Datum
416 ExprContext *econtext,
417 bool *isNull)
418{
419 return state->evalfunc(state, econtext, isNull);
420}
421#endif
422
423/*
424 * ExecEvalExprNoReturn
425 *
426 * Like ExecEvalExpr(), but for cases where no return value is expected,
427 * because the side-effects of expression evaluation are what's desired. This
428 * is e.g. used for projection and aggregate transition computation.
429
430 * Evaluate expression identified by "state" in the execution context
431 * given by "econtext".
432 *
433 * The caller should already have switched into the temporary memory context
434 * econtext->ecxt_per_tuple_memory. The convenience entry point
435 * ExecEvalExprNoReturnSwitchContext() is provided for callers who don't
436 * prefer to do the switch in an outer loop.
437 */
438#ifndef FRONTEND
439static inline void
441 ExprContext *econtext)
442{
444
445 retDatum = state->evalfunc(state, econtext, NULL);
446
447 Assert(retDatum == (Datum) 0);
448}
449#endif
450
451/*
452 * ExecEvalExprSwitchContext
453 *
454 * Same as ExecEvalExpr, but get into the right allocation context explicitly.
455 */
456#ifndef FRONTEND
457static inline Datum
459 ExprContext *econtext,
460 bool *isNull)
461{
462 Datum retDatum;
463 MemoryContext oldContext;
464
465 oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
466 retDatum = state->evalfunc(state, econtext, isNull);
467 MemoryContextSwitchTo(oldContext);
468 return retDatum;
469}
470#endif
471
472/*
473 * ExecEvalExprNoReturnSwitchContext
474 *
475 * Same as ExecEvalExprNoReturn, but get into the right allocation context
476 * explicitly.
477 */
478#ifndef FRONTEND
479static inline void
481 ExprContext *econtext)
482{
483 MemoryContext oldContext;
484
485 oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
486 ExecEvalExprNoReturn(state, econtext);
487 MemoryContextSwitchTo(oldContext);
488}
489#endif
490
491/*
492 * ExecProject
493 *
494 * Projects a tuple based on projection info and stores it in the slot passed
495 * to ExecBuildProjectionInfo().
496 *
497 * Note: the result is always a virtual tuple; therefore it may reference
498 * the contents of the exprContext's scan tuples and/or temporary results
499 * constructed in the exprContext. If the caller wishes the result to be
500 * valid longer than that data will be valid, he must call ExecMaterializeSlot
501 * on the result slot.
502 */
503#ifndef FRONTEND
504static inline TupleTableSlot *
506{
507 ExprContext *econtext = projInfo->pi_exprContext;
508 ExprState *state = &projInfo->pi_state;
509 TupleTableSlot *slot = state->resultslot;
510
511 /*
512 * Clear any former contents of the result slot. This makes it safe for
513 * us to use the slot's Datum/isnull arrays as workspace.
514 */
515 ExecClearTuple(slot);
516
517 /* Run the expression */
519
520 /*
521 * Successfully formed a result row. Mark the result slot as containing a
522 * valid virtual tuple (inlined version of ExecStoreVirtualTuple()).
523 */
524 slot->tts_flags &= ~TTS_FLAG_EMPTY;
525 slot->tts_nvalid = slot->tts_tupleDescriptor->natts;
526
527 return slot;
528}
529#endif
530
531/*
532 * ExecQual - evaluate a qual prepared with ExecInitQual (possibly via
533 * ExecPrepareQual). Returns true if qual is satisfied, else false.
534 *
535 * Note: ExecQual used to have a third argument "resultForNull". The
536 * behavior of this function now corresponds to resultForNull == false.
537 * If you want the resultForNull == true behavior, see ExecCheck.
538 */
539#ifndef FRONTEND
540static inline bool
542{
543 Datum ret;
544 bool isnull;
545
546 /* short-circuit (here and in ExecInitQual) for empty restriction list */
547 if (state == NULL)
548 return true;
549
550 /* verify that expression was compiled using ExecInitQual */
551 Assert(state->flags & EEO_FLAG_IS_QUAL);
552
553 ret = ExecEvalExprSwitchContext(state, econtext, &isnull);
554
555 /* EEOP_QUAL should never return NULL */
556 Assert(!isnull);
557
558 return DatumGetBool(ret);
559}
560#endif
561
562/*
563 * ExecQualAndReset() - evaluate qual with ExecQual() and reset expression
564 * context.
565 */
566#ifndef FRONTEND
567static inline bool
569{
570 bool ret = ExecQual(state, econtext);
571
572 /* inline ResetExprContext, to avoid ordering issue in this file */
574 return ret;
575}
576#endif
577
578extern bool ExecCheck(ExprState *state, ExprContext *econtext);
579
580/*
581 * prototypes from functions in execSRF.c
582 */
584 ExprContext *econtext, PlanState *parent);
586 ExprContext *econtext,
587 MemoryContext argContext,
588 TupleDesc expectedDesc,
589 bool randomAccess);
591 ExprContext *econtext, PlanState *parent);
593 ExprContext *econtext,
594 MemoryContext argContext,
595 bool *isNull,
596 ExprDoneCond *isDone);
597
598/*
599 * prototypes from functions in execScan.c
600 */
601typedef TupleTableSlot *(*ExecScanAccessMtd) (ScanState *node);
602typedef bool (*ExecScanRecheckMtd) (ScanState *node, TupleTableSlot *slot);
603
604extern TupleTableSlot *ExecScan(ScanState *node, ExecScanAccessMtd accessMtd,
605 ExecScanRecheckMtd recheckMtd);
606extern void ExecAssignScanProjectionInfo(ScanState *node);
607extern void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno);
608extern void ExecScanReScan(ScanState *node);
609
610/*
611 * prototypes from functions in execTuples.c
612 */
613extern void ExecInitResultTypeTL(PlanState *planstate);
614extern void ExecInitResultSlot(PlanState *planstate,
615 const TupleTableSlotOps *tts_ops);
616extern void ExecInitResultTupleSlotTL(PlanState *planstate,
617 const TupleTableSlotOps *tts_ops);
618extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate,
619 TupleDesc tupledesc,
620 const TupleTableSlotOps *tts_ops);
622 TupleDesc tupledesc,
623 const TupleTableSlotOps *tts_ops);
625 const TupleTableSlotOps *tts_ops);
626extern TupleDesc ExecTypeFromTL(List *targetList);
627extern TupleDesc ExecCleanTypeFromTL(List *targetList);
628extern TupleDesc ExecTypeFromExprList(List *exprList);
629extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList);
630extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
631
632typedef struct TupOutputState
633{
637
639 TupleDesc tupdesc,
640 const TupleTableSlotOps *tts_ops);
641extern void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull);
642extern void do_text_output_multiline(TupOutputState *tstate, const char *txt);
643extern void end_tup_output(TupOutputState *tstate);
644
645/*
646 * Write a single line of text given as a C string.
647 *
648 * Should only be used with a single-TEXT-attribute tupdesc.
649 */
650#define do_text_output_oneline(tstate, str_to_emit) \
651 do { \
652 Datum values_[1]; \
653 bool isnull_[1]; \
654 values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
655 isnull_[0] = false; \
656 do_tup_output(tstate, values_, isnull_); \
657 pfree(DatumGetPointer(values_[0])); \
658 } while (0)
659
660
661/*
662 * prototypes from functions in execUtils.c
663 */
664extern EState *CreateExecutorState(void);
665extern void FreeExecutorState(EState *estate);
666extern ExprContext *CreateExprContext(EState *estate);
669extern void FreeExprContext(ExprContext *econtext, bool isCommit);
670extern void ReScanExprContext(ExprContext *econtext);
671
672#define ResetExprContext(econtext) \
673 MemoryContextReset((econtext)->ecxt_per_tuple_memory)
674
676
677/* Get an EState's per-output-tuple exprcontext, making it if first use */
678#define GetPerTupleExprContext(estate) \
679 ((estate)->es_per_tuple_exprcontext ? \
680 (estate)->es_per_tuple_exprcontext : \
681 MakePerTupleExprContext(estate))
682
683#define GetPerTupleMemoryContext(estate) \
684 (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
685
686/* Reset an EState's per-output-tuple exprcontext, if one's been created */
687#define ResetPerTupleExprContext(estate) \
688 do { \
689 if ((estate)->es_per_tuple_exprcontext) \
690 ResetExprContext((estate)->es_per_tuple_exprcontext); \
691 } while (0)
692
693extern void ExecAssignExprContext(EState *estate, PlanState *planstate);
694extern TupleDesc ExecGetResultType(PlanState *planstate);
695extern const TupleTableSlotOps *ExecGetResultSlotOps(PlanState *planstate,
696 bool *isfixed);
697extern const TupleTableSlotOps *ExecGetCommonSlotOps(PlanState **planstates,
698 int nplans);
700extern void ExecAssignProjectionInfo(PlanState *planstate,
701 TupleDesc inputDesc);
703 TupleDesc inputDesc, int varno);
704extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc);
705extern void ExecCreateScanSlotFromOuterPlan(EState *estate,
706 ScanState *scanstate,
707 const TupleTableSlotOps *tts_ops);
708
709extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
710
711extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
712
713extern void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos,
714 Bitmapset *unpruned_relids);
715extern void ExecCloseRangeTableRelations(EState *estate);
716extern void ExecCloseResultRelations(EState *estate);
717
718static inline RangeTblEntry *
720{
721 return (RangeTblEntry *) list_nth(estate->es_range_table, rti - 1);
722}
723
725 bool isResultRel);
726extern void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo,
727 Index rti);
728
729extern int executor_errposition(EState *estate, int location);
730
731extern void RegisterExprContextCallback(ExprContext *econtext,
733 Datum arg);
734extern void UnregisterExprContextCallback(ExprContext *econtext,
736 Datum arg);
737
738extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname,
739 bool *isNull);
741 bool *isNull);
742
743extern int ExecTargetListLength(List *targetlist);
744extern int ExecCleanTargetListLength(List *targetlist);
745
749extern TupleTableSlot *ExecGetAllNullSlot(EState *estate, ResultRelInfo *relInfo);
751extern TupleConversionMap *ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate);
752
753extern Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate);
754extern Bitmapset *ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate);
755extern Bitmapset *ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate);
756extern Bitmapset *ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate);
757extern Bitmapset *ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate);
758
759/*
760 * prototypes from functions in execIndexing.c
761 */
762extern void ExecOpenIndices(ResultRelInfo *resultRelInfo, bool speculative);
763extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
764extern List *ExecInsertIndexTuples(ResultRelInfo *resultRelInfo,
765 TupleTableSlot *slot, EState *estate,
766 bool update,
767 bool noDupErr,
768 bool *specConflict, List *arbiterIndexes,
769 bool onlySummarizing);
770extern bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo,
771 TupleTableSlot *slot,
772 EState *estate, ItemPointer conflictTid,
773 ItemPointer tupleid,
774 List *arbiterIndexes);
776 IndexInfo *indexInfo,
777 ItemPointer tupleid,
778 const Datum *values, const bool *isnull,
779 EState *estate, bool newIndex);
780
781/*
782 * prototypes from functions in execReplication.c
783 */
784extern bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid,
785 LockTupleMode lockmode,
786 TupleTableSlot *searchslot,
787 TupleTableSlot *outslot);
788extern bool RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode,
789 TupleTableSlot *searchslot, TupleTableSlot *outslot);
790
791extern void ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo,
792 EState *estate, TupleTableSlot *slot);
793extern void ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo,
794 EState *estate, EPQState *epqstate,
795 TupleTableSlot *searchslot, TupleTableSlot *slot);
796extern void ExecSimpleRelationDelete(ResultRelInfo *resultRelInfo,
797 EState *estate, EPQState *epqstate,
798 TupleTableSlot *searchslot);
799extern void CheckCmdReplicaIdentity(Relation rel, CmdType cmd);
800
801extern void CheckSubscriptionRelkind(char relkind, const char *nspname,
802 const char *relname);
803
804/*
805 * prototypes from functions in nodeModifyTable.c
806 */
808 TupleTableSlot *planSlot,
809 TupleTableSlot *oldSlot);
811 Oid resultoid,
812 bool missing_ok,
813 bool update_cache);
814
815#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:230
TupleTableSlot *(* ExecProcNodeMtd)(struct PlanState *pstate)
Definition: execnodes.h:1144
ExprDoneCond
Definition: execnodes.h:321
struct TupleHashEntryData TupleHashEntryData
#define EEO_FLAG_IS_QUAL
Definition: execnodes.h:77
static MinimalTuple TupleHashEntryGetTuple(TupleHashEntry entry)
Definition: executor.h:175
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:496
Relation ExecGetRangeTableRelation(EState *estate, Index rti, bool isResultRel)
Definition: execUtils.c:826
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:2606
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:2632
TupleConversionMap * ExecGetRootToChildMap(ResultRelInfo *resultRelInfo, EState *estate)
Definition: execUtils.c:1327
ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)
Definition: execMain.c:2655
ResultRelInfo * ExecGetTriggerResultRel(EState *estate, Oid relid, ResultRelInfo *rootRelInfo)
Definition: execMain.c:1430
void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation, List *mergeActions)
Definition: execMain.c:1152
void ExecAssignScanProjectionInfoWithVarno(ScanState *node, int varno)
Definition: execScan.c:94
PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook
Definition: execMain.c:73
TupleTableSlot * EvalPlanQualSlot(EPQState *epqstate, Relation relation, Index rti)
Definition: execMain.c:2853
Bitmapset * ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1404
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:3008
Bitmapset * ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate)
Definition: execUtils.c:1362
TupleTableSlot * ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1227
PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook
Definition: execMain.c:70
char * ExecBuildSlotValueDescription(Oid reloid, TupleTableSlot *slot, TupleDesc tupdesc, Bitmapset *modifiedCols, int maxfieldlen)
Definition: execMain.c:2467
ExprState * ExecBuildHash32FromAttrs(TupleDesc desc, const TupleTableSlotOps *ops, FmgrInfo *hashfunctions, Oid *collations, int numCols, AttrNumber *keyColIdx, PlanState *parent, uint32 init_value)
Definition: execExpr.c:4141
bool ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:128
void ReScanExprContext(ExprContext *econtext)
Definition: execUtils.c:444
static TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
Definition: executor.h:505
bool ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate, bool emitError)
Definition: execMain.c:1932
static void * TupleHashEntryGetAdditional(TupleHashTable hashtable, TupleHashEntry entry)
Definition: executor.h:189
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
static bool ExecShouldLockRelations(EState *estate)
Definition: executor.h:322
bool ExecCheck(ExprState *state, ExprContext *econtext)
Definition: execExpr.c:872
ExprContext * CreateExprContext(EState *estate)
Definition: execUtils.c:308
ExprState * ExecInitCheck(List *qual, PlanState *parent)
Definition: execExpr.c:315
SetExprState * ExecInitFunctionResultSet(Expr *expr, ExprContext *econtext, PlanState *parent)
Definition: execSRF.c:444
void ExecutorStartCachedPlan(QueryDesc *queryDesc, int eflags, CachedPlanSource *plansource, int query_index)
Definition: execMain.c:295
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
TupleConversionMap * ExecGetChildToRootMap(ResultRelInfo *resultRelInfo)
Definition: execUtils.c:1301
ExprContext * CreateStandaloneExprContext(void)
Definition: execUtils.c:358
void ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:538
void EvalPlanQualInit(EPQState *epqstate, EState *parentestate, Plan *subplan, List *auxrowmarks, int epqParam, List *resultRelations)
Definition: execMain.c:2794
TupleTableSlot * ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1205
TupleDesc ExecCleanTypeFromTL(List *targetList)
Definition: execTuples.c:2139
void ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate)
Definition: execMain.c:2304
int executor_errposition(EState *estate, int location)
Definition: execUtils.c:937
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:719
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:1125
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:417
void ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos, Bitmapset *unpruned_relids)
Definition: execUtils.c:774
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:1383
TupleTableSlot * ExecGetUpdateNewTuple(ResultRelInfo *relinfo, TupleTableSlot *planSlot, TupleTableSlot *oldSlot)
const TupleTableSlotOps * ExecGetCommonSlotOps(PlanState **planstates, int nplans)
Definition: execUtils.c:537
void ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo, Index rti)
Definition: execUtils.c:881
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:1329
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 ExecCreateScanSlotFromOuterPlan(EState *estate, ScanState *scanstate, const TupleTableSlotOps *tts_ops)
Definition: execUtils.c:705
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:475
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:3249
void ExecInitResultTypeTL(PlanState *planstate)
Definition: execTuples.c:1944
void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks)
Definition: execMain.c:2836
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:80
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:72
void ExecutorRewind(QueryDesc *queryDesc)
Definition: execMain.c:615
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:486
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:2170
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:2725
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
Definition: execUtils.c:584
static bool ExecQual(ExprState *state, ExprContext *econtext)
Definition: executor.h:541
ExprContext * MakePerTupleExprContext(EState *estate)
Definition: execUtils.c:459
void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
Definition: execUtils.c:990
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:693
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
Definition: executor.h:602
const TupleTableSlotOps * ExecGetCommonChildSlotOps(PlanState *ps)
Definition: execUtils.c:564
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:94
bool(* ExecutorStart_hook_type)(QueryDesc *queryDesc, int eflags)
Definition: executor.h:76
uint32 TupleHashTableHash(TupleHashTable hashtable, TupleTableSlot *slot)
Definition: execGrouping.c:327
bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
Definition: execMain.c:2881
List * ExecInitExprList(List *nodes, PlanState *parent)
Definition: execExpr.c:335
void ExecConditionalAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc, int varno)
Definition: execUtils.c:604
bool standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
Definition: execMain.c:151
void(* ExecutorEnd_hook_type)(QueryDesc *queryDesc)
Definition: executor.h:90
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:964
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
Definition: executor.h:568
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:1176
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:193
struct TupOutputState TupOutputState
static size_t TupleHashEntrySize(void)
Definition: executor.h:166
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:730
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:1651
static TupleTableSlot * ExecProcNode(PlanState *node)
Definition: executor.h:336
TupleTableSlot * ExecGetAllNullSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1274
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:1186
ExprContext * CreateWorkExprContext(EState *estate)
Definition: execUtils.c:323
static bool ExecPlanStillValid(EState *estate)
Definition: executor.h:311
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:2444
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
Definition: executor.h:601
void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg)
Definition: execUtils.c:911
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:505
Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull)
Definition: execUtils.c:1062
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:76
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:1419
void ExecReScan(PlanState *node)
Definition: execAmi.c:77
static void ExecEvalExprNoReturn(ExprState *state, ExprContext *econtext)
Definition: executor.h:440
PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook
Definition: execMain.c:71
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:375
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:415
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:547
void ExecRestrPos(PlanState *node)
Definition: execAmi.c:376
static void ExecEvalExprNoReturnSwitchContext(ExprState *state, ExprContext *econtext)
Definition: executor.h:480
void ExecCloseRangeTableRelations(EState *estate)
Definition: execMain.c:1711
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
Definition: executor.h:458
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:1985
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:2056
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:2036
TupleTableSlot * ExecGetReturningSlot(EState *estate, ResultRelInfo *relInfo)
Definition: execUtils.c:1249
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
Definition: execUtils.c:743
bool ExecCheckPermissions(List *rangeTable, List *rteperminfos, bool ereport_on_violation)
Definition: execMain.c:661
static Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)
Definition: executor.h:222
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count)
Definition: execMain.c:365
Oid ExecGetResultRelCheckAsUser(ResultRelInfo *relInfo, EState *estate)
Definition: execUtils.c:1490
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:1506
TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)
Definition: execMain.c:2992
void standard_ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:484
Assert(PointerIsAligned(start, uint64))
struct parser_state ps
return false
Definition: isn.c:135
return true
Definition: isn.c:130
LockTupleMode
Definition: lockoptions.h:50
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:414
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 CachedPlanRequiresLocking(CachedPlan *cplan)
Definition: plancache.h:276
static bool CachedPlanValid(CachedPlan *cplan)
Definition: plancache.h:289
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
CachedPlan * es_cachedplan
Definition: execnodes.h:667
List * es_range_table
Definition: execnodes.h:659
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:276
Definition: fmgr.h:57
Definition: pg_list.h:54
Definition: nodes.h:135
Bitmapset * chgParam
Definition: execnodes.h:1191
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1165
ExprState pi_state
Definition: execnodes.h:381
ExprContext * pi_exprContext
Definition: execnodes.h:383
TupleTableSlot * slot
Definition: executor.h:634
DestReceiver * dest
Definition: executor.h:635
MinimalTuple firstTuple
Definition: execnodes.h:848
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