PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
execUtils.c File Reference
#include "postgres.h"
#include "access/relscan.h"
#include "access/transam.h"
#include "executor/executor.h"
#include "nodes/nodeFuncs.h"
#include "parser/parsetree.h"
#include "storage/lmgr.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
#include "utils/rel.h"
#include "utils/typcache.h"
Include dependency graph for execUtils.c:

Go to the source code of this file.

Functions

static void ShutdownExprContext (ExprContext *econtext, bool isCommit)
 
EStateCreateExecutorState (void)
 
void FreeExecutorState (EState *estate)
 
ExprContextCreateExprContext (EState *estate)
 
ExprContextCreateStandaloneExprContext (void)
 
void FreeExprContext (ExprContext *econtext, bool isCommit)
 
void ReScanExprContext (ExprContext *econtext)
 
ExprContextMakePerTupleExprContext (EState *estate)
 
void ExecAssignExprContext (EState *estate, PlanState *planstate)
 
void ExecAssignResultType (PlanState *planstate, TupleDesc tupDesc)
 
void ExecAssignResultTypeFromTL (PlanState *planstate)
 
TupleDesc ExecGetResultType (PlanState *planstate)
 
void ExecAssignProjectionInfo (PlanState *planstate, TupleDesc inputDesc)
 
void ExecFreeExprContext (PlanState *planstate)
 
void ExecAssignScanType (ScanState *scanstate, TupleDesc tupDesc)
 
void ExecAssignScanTypeFromOuterPlan (ScanState *scanstate)
 
bool ExecRelationIsTargetRelation (EState *estate, Index scanrelid)
 
Relation ExecOpenScanRelation (EState *estate, Index scanrelid, int eflags)
 
void ExecCloseScanRelation (Relation scanrel)
 
void UpdateChangedParamSet (PlanState *node, Bitmapset *newchg)
 
void RegisterExprContextCallback (ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
 
void UnregisterExprContextCallback (ExprContext *econtext, ExprContextCallbackFunction function, Datum arg)
 
void ExecLockNonLeafAppendTables (List *partitioned_rels, EState *estate)
 
Datum GetAttributeByName (HeapTupleHeader tuple, const char *attname, bool *isNull)
 
Datum GetAttributeByNum (HeapTupleHeader tuple, AttrNumber attrno, bool *isNull)
 
int ExecTargetListLength (List *targetlist)
 
int ExecCleanTargetListLength (List *targetlist)
 

Function Documentation

EState* CreateExecutorState ( void  )

Definition at line 77 of file execUtils.c.

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate(), CurrentMemoryContext, EState::es_auxmodifytables, EState::es_crosscheck_snapshot, EState::es_direction, EState::es_epqScanDone, EState::es_epqTuple, EState::es_epqTupleSet, EState::es_exprcontexts, EState::es_finished, EState::es_instrument, EState::es_junkFilter, EState::es_lastoid, EState::es_num_result_relations, EState::es_output_cid, EState::es_param_exec_vals, EState::es_param_list_info, EState::es_per_tuple_exprcontext, EState::es_plannedstmt, EState::es_processed, EState::es_query_cxt, EState::es_range_table, EState::es_result_relation_info, EState::es_result_relations, EState::es_rowMarks, EState::es_snapshot, EState::es_sourceText, EState::es_subplanstates, EState::es_top_eflags, EState::es_trig_newtup_slot, EState::es_trig_oldtup_slot, EState::es_trig_target_relations, EState::es_trig_tuple_slot, EState::es_tupleTable, ForwardScanDirection, InvalidOid, InvalidSnapshot, makeNode, MemoryContextSwitchTo(), NIL, and NULL.

Referenced by afterTriggerInvokeEvents(), ATRewriteTable(), compute_index_stats(), CopyFrom(), create_estate_for_relation(), EvalPlanQualStart(), evaluate_expr(), ExecuteQuery(), ExecuteTruncate(), ExplainExecuteQuery(), get_actual_variable_range(), get_qual_for_range(), IndexBuildHeapRangeScan(), IndexCheckExclusion(), operator_predicate_proof(), plpgsql_create_econtext(), plpgsql_inline_handler(), standard_ExecutorStart(), tuplesort_begin_cluster(), unique_key_recheck(), validate_index_heapscan(), validateCheckConstraint(), and validateDomainConstraint().

78 {
79  EState *estate;
80  MemoryContext qcontext;
81  MemoryContext oldcontext;
82 
83  /*
84  * Create the per-query context for this Executor run.
85  */
87  "ExecutorState",
89 
90  /*
91  * Make the EState node within the per-query context. This way, we don't
92  * need a separate pfree() operation for it at shutdown.
93  */
94  oldcontext = MemoryContextSwitchTo(qcontext);
95 
96  estate = makeNode(EState);
97 
98  /*
99  * Initialize all fields of the Executor State structure
100  */
102  estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */
103  estate->es_crosscheck_snapshot = InvalidSnapshot; /* no crosscheck */
104  estate->es_range_table = NIL;
105  estate->es_plannedstmt = NULL;
106 
107  estate->es_junkFilter = NULL;
108 
109  estate->es_output_cid = (CommandId) 0;
110 
111  estate->es_result_relations = NULL;
112  estate->es_num_result_relations = 0;
113  estate->es_result_relation_info = NULL;
114 
115  estate->es_trig_target_relations = NIL;
116  estate->es_trig_tuple_slot = NULL;
117  estate->es_trig_oldtup_slot = NULL;
118  estate->es_trig_newtup_slot = NULL;
119 
120  estate->es_param_list_info = NULL;
121  estate->es_param_exec_vals = NULL;
122 
123  estate->es_query_cxt = qcontext;
124 
125  estate->es_tupleTable = NIL;
126 
127  estate->es_rowMarks = NIL;
128 
129  estate->es_processed = 0;
130  estate->es_lastoid = InvalidOid;
131 
132  estate->es_top_eflags = 0;
133  estate->es_instrument = 0;
134  estate->es_finished = false;
135 
136  estate->es_exprcontexts = NIL;
137 
138  estate->es_subplanstates = NIL;
139 
140  estate->es_auxmodifytables = NIL;
141 
142  estate->es_per_tuple_exprcontext = NULL;
143 
144  estate->es_epqTuple = NULL;
145  estate->es_epqTupleSet = NULL;
146  estate->es_epqScanDone = NULL;
147  estate->es_sourceText = NULL;
148 
149  /*
150  * Return the executor state structure
151  */
152  MemoryContextSwitchTo(oldcontext);
153 
154  return estate;
155 }
#define NIL
Definition: pg_list.h:69
uint32 CommandId
Definition: c.h:411
HeapTuple * es_epqTuple
Definition: execnodes.h:470
JunkFilter * es_junkFilter
Definition: execnodes.h:414
CommandId es_output_cid
Definition: execnodes.h:417
TupleTableSlot * es_trig_newtup_slot
Definition: execnodes.h:428
Oid es_lastoid
Definition: execnodes.h:442
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
PlannedStmt * es_plannedstmt
Definition: execnodes.h:411
Snapshot es_crosscheck_snapshot
Definition: execnodes.h:409
ExprContext * es_per_tuple_exprcontext
Definition: execnodes.h:459
Snapshot es_snapshot
Definition: execnodes.h:408
List * es_range_table
Definition: execnodes.h:410
ScanDirection es_direction
Definition: execnodes.h:407
const char * es_sourceText
Definition: execnodes.h:412
ParamExecData * es_param_exec_vals
Definition: execnodes.h:432
MemoryContext es_query_cxt
Definition: execnodes.h:435
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:165
ResultRelInfo * es_result_relations
Definition: execnodes.h:420
TupleTableSlot * es_trig_oldtup_slot
Definition: execnodes.h:427
MemoryContext CurrentMemoryContext
Definition: mcxt.c:37
int es_instrument
Definition: execnodes.h:445
TupleTableSlot * es_trig_tuple_slot
Definition: execnodes.h:426
#define InvalidSnapshot
Definition: snapshot.h:25
List * es_trig_target_relations
Definition: execnodes.h:425
List * es_tupleTable
Definition: execnodes.h:437
MemoryContext AllocSetContextCreate(MemoryContext parent, const char *name, Size minContextSize, Size initBlockSize, Size maxBlockSize)
Definition: aset.c:322
List * es_auxmodifytables
Definition: execnodes.h:452
int es_num_result_relations
Definition: execnodes.h:421
#define InvalidOid
Definition: postgres_ext.h:36
bool es_finished
Definition: execnodes.h:446
#define makeNode(_type_)
Definition: nodes.h:554
#define NULL
Definition: c.h:229
uint64 es_processed
Definition: execnodes.h:441
bool * es_epqTupleSet
Definition: execnodes.h:471
List * es_subplanstates
Definition: execnodes.h:450
List * es_rowMarks
Definition: execnodes.h:439
int es_top_eflags
Definition: execnodes.h:444
bool * es_epqScanDone
Definition: execnodes.h:472
ParamListInfo es_param_list_info
Definition: execnodes.h:431
List * es_exprcontexts
Definition: execnodes.h:448
ResultRelInfo * es_result_relation_info
Definition: execnodes.h:422
ExprContext* CreateExprContext ( EState estate)

Definition at line 213 of file execUtils.c.

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate(), ExprContext::caseValue_datum, ExprContext::caseValue_isNull, ExprContext::domainValue_datum, ExprContext::domainValue_isNull, ExprContext::ecxt_aggnulls, ExprContext::ecxt_aggvalues, ExprContext::ecxt_callbacks, ExprContext::ecxt_estate, ExprContext::ecxt_innertuple, ExprContext::ecxt_outertuple, ExprContext::ecxt_param_exec_vals, ExprContext::ecxt_param_list_info, ExprContext::ecxt_per_query_memory, ExprContext::ecxt_per_tuple_memory, ExprContext::ecxt_scantuple, EState::es_exprcontexts, EState::es_param_exec_vals, EState::es_param_list_info, EState::es_query_cxt, lcons(), makeNode, MemoryContextSwitchTo(), and NULL.

Referenced by ExecAssignExprContext(), ExecInitMergeJoin(), ExecInitSubPlan(), MakePerTupleExprContext(), and plpgsql_create_econtext().

214 {
215  ExprContext *econtext;
216  MemoryContext oldcontext;
217 
218  /* Create the ExprContext node within the per-query memory context */
219  oldcontext = MemoryContextSwitchTo(estate->es_query_cxt);
220 
221  econtext = makeNode(ExprContext);
222 
223  /* Initialize fields of ExprContext */
224  econtext->ecxt_scantuple = NULL;
225  econtext->ecxt_innertuple = NULL;
226  econtext->ecxt_outertuple = NULL;
227 
228  econtext->ecxt_per_query_memory = estate->es_query_cxt;
229 
230  /*
231  * Create working memory for expression evaluation in this context.
232  */
233  econtext->ecxt_per_tuple_memory =
235  "ExprContext",
237 
238  econtext->ecxt_param_exec_vals = estate->es_param_exec_vals;
239  econtext->ecxt_param_list_info = estate->es_param_list_info;
240 
241  econtext->ecxt_aggvalues = NULL;
242  econtext->ecxt_aggnulls = NULL;
243 
244  econtext->caseValue_datum = (Datum) 0;
245  econtext->caseValue_isNull = true;
246 
247  econtext->domainValue_datum = (Datum) 0;
248  econtext->domainValue_isNull = true;
249 
250  econtext->ecxt_estate = estate;
251 
252  econtext->ecxt_callbacks = NULL;
253 
254  /*
255  * Link the ExprContext into the EState to ensure it is shut down when the
256  * EState is freed. Because we use lcons(), shutdowns will occur in
257  * reverse order of creation, which may not be essential but can't hurt.
258  */
259  estate->es_exprcontexts = lcons(econtext, estate->es_exprcontexts);
260 
261  MemoryContextSwitchTo(oldcontext);
262 
263  return econtext;
264 }
Datum * ecxt_aggvalues
Definition: execnodes.h:212
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:202
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
Datum domainValue_datum
Definition: execnodes.h:220
ParamExecData * es_param_exec_vals
Definition: execnodes.h:432
MemoryContext es_query_cxt
Definition: execnodes.h:435
Datum caseValue_datum
Definition: execnodes.h:216
ExprContext_CB * ecxt_callbacks
Definition: execnodes.h:227
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:165
TupleTableSlot * ecxt_innertuple
Definition: execnodes.h:197
ParamExecData * ecxt_param_exec_vals
Definition: execnodes.h:205
struct EState * ecxt_estate
Definition: execnodes.h:224
bool domainValue_isNull
Definition: execnodes.h:221
bool * ecxt_aggnulls
Definition: execnodes.h:213
MemoryContext AllocSetContextCreate(MemoryContext parent, const char *name, Size minContextSize, Size initBlockSize, Size maxBlockSize)
Definition: aset.c:322
uintptr_t Datum
Definition: postgres.h:372
List * lcons(void *datum, List *list)
Definition: list.c:259
#define makeNode(_type_)
Definition: nodes.h:554
TupleTableSlot * ecxt_outertuple
Definition: execnodes.h:198
#define NULL
Definition: c.h:229
TupleTableSlot * ecxt_scantuple
Definition: execnodes.h:196
MemoryContext ecxt_per_query_memory
Definition: execnodes.h:201
bool caseValue_isNull
Definition: execnodes.h:217
ParamListInfo es_param_list_info
Definition: execnodes.h:431
List * es_exprcontexts
Definition: execnodes.h:448
ParamListInfo ecxt_param_list_info
Definition: execnodes.h:206
ExprContext* CreateStandaloneExprContext ( void  )

Definition at line 285 of file execUtils.c.

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate(), ExprContext::caseValue_datum, ExprContext::caseValue_isNull, CurrentMemoryContext, ExprContext::domainValue_datum, ExprContext::domainValue_isNull, ExprContext::ecxt_aggnulls, ExprContext::ecxt_aggvalues, ExprContext::ecxt_callbacks, ExprContext::ecxt_estate, ExprContext::ecxt_innertuple, ExprContext::ecxt_outertuple, ExprContext::ecxt_param_exec_vals, ExprContext::ecxt_param_list_info, ExprContext::ecxt_per_query_memory, ExprContext::ecxt_per_tuple_memory, ExprContext::ecxt_scantuple, makeNode, and NULL.

Referenced by domain_check_input().

286 {
287  ExprContext *econtext;
288 
289  /* Create the ExprContext node within the caller's memory context */
290  econtext = makeNode(ExprContext);
291 
292  /* Initialize fields of ExprContext */
293  econtext->ecxt_scantuple = NULL;
294  econtext->ecxt_innertuple = NULL;
295  econtext->ecxt_outertuple = NULL;
296 
298 
299  /*
300  * Create working memory for expression evaluation in this context.
301  */
302  econtext->ecxt_per_tuple_memory =
304  "ExprContext",
306 
307  econtext->ecxt_param_exec_vals = NULL;
308  econtext->ecxt_param_list_info = NULL;
309 
310  econtext->ecxt_aggvalues = NULL;
311  econtext->ecxt_aggnulls = NULL;
312 
313  econtext->caseValue_datum = (Datum) 0;
314  econtext->caseValue_isNull = true;
315 
316  econtext->domainValue_datum = (Datum) 0;
317  econtext->domainValue_isNull = true;
318 
319  econtext->ecxt_estate = NULL;
320 
321  econtext->ecxt_callbacks = NULL;
322 
323  return econtext;
324 }
Datum * ecxt_aggvalues
Definition: execnodes.h:212
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:202
Datum domainValue_datum
Definition: execnodes.h:220
Datum caseValue_datum
Definition: execnodes.h:216
ExprContext_CB * ecxt_callbacks
Definition: execnodes.h:227
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:165
TupleTableSlot * ecxt_innertuple
Definition: execnodes.h:197
ParamExecData * ecxt_param_exec_vals
Definition: execnodes.h:205
struct EState * ecxt_estate
Definition: execnodes.h:224
MemoryContext CurrentMemoryContext
Definition: mcxt.c:37
bool domainValue_isNull
Definition: execnodes.h:221
bool * ecxt_aggnulls
Definition: execnodes.h:213
MemoryContext AllocSetContextCreate(MemoryContext parent, const char *name, Size minContextSize, Size initBlockSize, Size maxBlockSize)
Definition: aset.c:322
uintptr_t Datum
Definition: postgres.h:372
#define makeNode(_type_)
Definition: nodes.h:554
TupleTableSlot * ecxt_outertuple
Definition: execnodes.h:198
#define NULL
Definition: c.h:229
TupleTableSlot * ecxt_scantuple
Definition: execnodes.h:196
MemoryContext ecxt_per_query_memory
Definition: execnodes.h:201
bool caseValue_isNull
Definition: execnodes.h:217
ParamListInfo ecxt_param_list_info
Definition: execnodes.h:206
void ExecAssignProjectionInfo ( PlanState planstate,
TupleDesc  inputDesc 
)

Definition at line 482 of file execUtils.c.

References ExecBuildProjectionInfo(), PlanState::plan, PlanState::ps_ExprContext, PlanState::ps_ProjInfo, PlanState::ps_ResultTupleSlot, and Plan::targetlist.

Referenced by ExecAssignScanProjectionInfoWithVarno(), ExecInitAgg(), ExecInitGather(), ExecInitGatherMerge(), ExecInitGroup(), ExecInitHashJoin(), ExecInitMergeJoin(), ExecInitNestLoop(), ExecInitResult(), and ExecInitWindowAgg().

484 {
485  planstate->ps_ProjInfo =
487  planstate->ps_ExprContext,
488  planstate->ps_ResultTupleSlot,
489  planstate,
490  inputDesc);
491 }
ProjectionInfo * ps_ProjInfo
Definition: execnodes.h:831
ExprContext * ps_ExprContext
Definition: execnodes.h:830
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:829
Plan * plan
Definition: execnodes.h:800
List * targetlist
Definition: plannodes.h:132
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, PlanState *parent, TupleDesc inputDesc)
Definition: execExpr.c:301
void ExecAssignResultType ( PlanState planstate,
TupleDesc  tupDesc 
)

Definition at line 423 of file execUtils.c.

References ExecSetSlotDescriptor(), and PlanState::ps_ResultTupleSlot.

Referenced by ExecAssignResultTypeFromTL(), and ExecInitModifyTable().

424 {
425  TupleTableSlot *slot = planstate->ps_ResultTupleSlot;
426 
427  ExecSetSlotDescriptor(slot, tupDesc);
428 }
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:829
void ExecSetSlotDescriptor(TupleTableSlot *slot, TupleDesc tupdesc)
Definition: execTuples.c:247
void ExecAssignResultTypeFromTL ( PlanState planstate)

Definition at line 435 of file execUtils.c.

References ExecAssignResultType(), ExecContextForcesOids(), ExecTypeFromTL(), PlanState::plan, and Plan::targetlist.

Referenced by ExecInitAgg(), ExecInitAppend(), ExecInitBitmapHeapScan(), ExecInitCteScan(), ExecInitCustomScan(), ExecInitForeignScan(), ExecInitFunctionScan(), ExecInitGather(), ExecInitGatherMerge(), ExecInitGroup(), ExecInitHash(), ExecInitHashJoin(), ExecInitIndexOnlyScan(), ExecInitIndexScan(), ExecInitLimit(), ExecInitLockRows(), ExecInitMaterial(), ExecInitMergeAppend(), ExecInitMergeJoin(), ExecInitNestLoop(), ExecInitProjectSet(), ExecInitRecursiveUnion(), ExecInitResult(), ExecInitSampleScan(), ExecInitSeqScan(), ExecInitSetOp(), ExecInitSort(), ExecInitSubqueryScan(), ExecInitTableFuncScan(), ExecInitTidScan(), ExecInitUnique(), ExecInitValuesScan(), ExecInitWindowAgg(), and ExecInitWorkTableScan().

436 {
437  bool hasoid;
438  TupleDesc tupDesc;
439 
440  if (ExecContextForcesOids(planstate, &hasoid))
441  {
442  /* context forces OID choice; hasoid is now set correctly */
443  }
444  else
445  {
446  /* given free choice, don't leave space for OIDs in result tuples */
447  hasoid = false;
448  }
449 
450  /*
451  * ExecTypeFromTL needs the parse-time representation of the tlist, not a
452  * list of ExprStates. This is good because some plan nodes don't bother
453  * to set up planstate->targetlist ...
454  */
455  tupDesc = ExecTypeFromTL(planstate->plan->targetlist, hasoid);
456  ExecAssignResultType(planstate, tupDesc);
457 }
void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc)
Definition: execUtils.c:423
TupleDesc ExecTypeFromTL(List *targetList, bool hasoid)
Definition: execTuples.c:888
Plan * plan
Definition: execnodes.h:800
List * targetlist
Definition: plannodes.h:132
bool ExecContextForcesOids(PlanState *planstate, bool *hasoids)
Definition: execMain.c:1440
void ExecAssignScanType ( ScanState scanstate,
TupleDesc  tupDesc 
)
void ExecAssignScanTypeFromOuterPlan ( ScanState scanstate)

Definition at line 547 of file execUtils.c.

References ExecAssignScanType(), ExecGetResultType(), outerPlan, and outerPlanState.

Referenced by ExecInitAgg(), ExecInitGroup(), ExecInitMaterial(), ExecInitSort(), and ExecInitWindowAgg().

548 {
550  TupleDesc tupDesc;
551 
552  outerPlan = outerPlanState(scanstate);
553  tupDesc = ExecGetResultType(outerPlan);
554 
555  ExecAssignScanType(scanstate, tupDesc);
556 }
#define outerPlanState(node)
Definition: execnodes.h:842
#define outerPlan(node)
Definition: plannodes.h:162
TupleDesc ExecGetResultType(PlanState *planstate)
Definition: execUtils.c:464
void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc)
Definition: execUtils.c:535
int ExecCleanTargetListLength ( List targetlist)

Definition at line 972 of file execUtils.c.

References castNode, lfirst, and TargetEntry::resjunk.

Referenced by check_sql_fn_retval(), and ExecTypeFromTLInternal().

973 {
974  int len = 0;
975  ListCell *tl;
976 
977  foreach(tl, targetlist)
978  {
979  TargetEntry *curTle = castNode(TargetEntry, lfirst(tl));
980 
981  if (!curTle->resjunk)
982  len++;
983  }
984  return len;
985 }
#define castNode(_type_, nodeptr)
Definition: nodes.h:575
bool resjunk
Definition: primnodes.h:1359
#define lfirst(lc)
Definition: pg_list.h:106
void ExecCloseScanRelation ( Relation  scanrel)

Definition at line 656 of file execUtils.c.

References heap_close, and NoLock.

Referenced by ExecEndBitmapHeapScan(), ExecEndCustomScan(), ExecEndForeignScan(), ExecEndIndexOnlyScan(), ExecEndIndexScan(), ExecEndSampleScan(), ExecEndSeqScan(), and ExecEndTidScan().

657 {
658  heap_close(scanrel, NoLock);
659 }
#define heap_close(r, l)
Definition: heapam.h:97
#define NoLock
Definition: lockdefs.h:34
void ExecFreeExprContext ( PlanState planstate)
void ExecLockNonLeafAppendTables ( List partitioned_rels,
EState estate 
)

Definition at line 791 of file execUtils.c.

References AccessShareLock, EState::es_plannedstmt, EState::es_range_table, getrelid, lfirst, lfirst_int, LockRelationOid(), PlanRowMark::markType, PlannedStmt::nonleafResultRelations, NULL, RowMarkRequiresRowShareLock, PlannedStmt::rowMarks, and RowShareLock.

Referenced by ExecInitAppend(), and ExecInitMergeAppend().

792 {
793  PlannedStmt *stmt = estate->es_plannedstmt;
794  ListCell *lc;
795 
796  foreach(lc, partitioned_rels)
797  {
798  ListCell *l;
799  Index rti = lfirst_int(lc);
800  bool is_result_rel = false;
801  Oid relid = getrelid(rti, estate->es_range_table);
802 
803  /* If this is a result relation, already locked in InitPlan */
804  foreach(l, stmt->nonleafResultRelations)
805  {
806  if (rti == lfirst_int(l))
807  {
808  is_result_rel = true;
809  break;
810  }
811  }
812 
813  /*
814  * Not a result relation; check if there is a RowMark that requires
815  * taking a RowShareLock on this rel.
816  */
817  if (!is_result_rel)
818  {
819  PlanRowMark *rc = NULL;
820 
821  foreach(l, stmt->rowMarks)
822  {
823  if (((PlanRowMark *) lfirst(l))->rti == rti)
824  {
825  rc = lfirst(l);
826  break;
827  }
828  }
829 
830  if (rc && RowMarkRequiresRowShareLock(rc->markType))
832  else
834  }
835  }
836 }
RowMarkType markType
Definition: plannodes.h:981
List * nonleafResultRelations
Definition: plannodes.h:69
#define AccessShareLock
Definition: lockdefs.h:36
PlannedStmt * es_plannedstmt
Definition: execnodes.h:411
List * es_range_table
Definition: execnodes.h:410
unsigned int Oid
Definition: postgres_ext.h:31
#define RowMarkRequiresRowShareLock(marktype)
Definition: plannodes.h:934
#define lfirst_int(lc)
Definition: pg_list.h:107
#define RowShareLock
Definition: lockdefs.h:37
unsigned int Index
Definition: c.h:365
List * rowMarks
Definition: plannodes.h:75
#define NULL
Definition: c.h:229
#define lfirst(lc)
Definition: pg_list.h:106
#define getrelid(rangeindex, rangetable)
Definition: parsetree.h:41
void LockRelationOid(Oid relid, LOCKMODE lockmode)
Definition: lmgr.c:105
Relation ExecOpenScanRelation ( EState estate,
Index  scanrelid,
int  eflags 
)

Definition at line 598 of file execUtils.c.

References AccessShareLock, ereport, errcode(), errhint(), errmsg(), ERROR, EState::es_range_table, EXEC_FLAG_EXPLAIN_ONLY, EXEC_FLAG_WITH_NO_DATA, ExecFindRowMark(), ExecRelationIsTargetRelation(), getrelid, heap_open(), NoLock, NULL, ExecRowMark::relation, RelationGetRelationName, and RelationIsScannable.

Referenced by ExecInitBitmapHeapScan(), ExecInitCustomScan(), ExecInitForeignScan(), ExecInitIndexOnlyScan(), ExecInitIndexScan(), ExecInitTidScan(), and InitScanRelation().

599 {
600  Relation rel;
601  Oid reloid;
602  LOCKMODE lockmode;
603 
604  /*
605  * Determine the lock type we need. First, scan to see if target relation
606  * is a result relation. If not, check if it's a FOR UPDATE/FOR SHARE
607  * relation. In either of those cases, we got the lock already.
608  */
609  lockmode = AccessShareLock;
610  if (ExecRelationIsTargetRelation(estate, scanrelid))
611  lockmode = NoLock;
612  else
613  {
614  /* Keep this check in sync with InitPlan! */
615  ExecRowMark *erm = ExecFindRowMark(estate, scanrelid, true);
616 
617  if (erm != NULL && erm->relation != NULL)
618  lockmode = NoLock;
619  }
620 
621  /* Open the relation and acquire lock as needed */
622  reloid = getrelid(scanrelid, estate->es_range_table);
623  rel = heap_open(reloid, lockmode);
624 
625  /*
626  * Complain if we're attempting a scan of an unscannable relation, except
627  * when the query won't actually be run. This is a slightly klugy place
628  * to do this, perhaps, but there is no better place.
629  */
630  if ((eflags & (EXEC_FLAG_EXPLAIN_ONLY | EXEC_FLAG_WITH_NO_DATA)) == 0 &&
631  !RelationIsScannable(rel))
632  ereport(ERROR,
633  (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
634  errmsg("materialized view \"%s\" has not been populated",
636  errhint("Use the REFRESH MATERIALIZED VIEW command.")));
637 
638  return rel;
639 }
int errhint(const char *fmt,...)
Definition: elog.c:987
int LOCKMODE
Definition: lockdefs.h:26
#define RelationIsScannable(relation)
Definition: rel.h:545
Relation relation
Definition: execnodes.h:498
#define AccessShareLock
Definition: lockdefs.h:36
int errcode(int sqlerrcode)
Definition: elog.c:575
#define EXEC_FLAG_WITH_NO_DATA
Definition: executor.h:65
List * es_range_table
Definition: execnodes.h:410
unsigned int Oid
Definition: postgres_ext.h:31
#define ERROR
Definition: elog.h:43
#define NoLock
Definition: lockdefs.h:34
#define RelationGetRelationName(relation)
Definition: rel.h:437
#define ereport(elevel, rest)
Definition: elog.h:122
Relation heap_open(Oid relationId, LOCKMODE lockmode)
Definition: heapam.c:1287
#define NULL
Definition: c.h:229
int errmsg(const char *fmt,...)
Definition: elog.c:797
#define getrelid(rangeindex, rangetable)
Definition: parsetree.h:41
#define EXEC_FLAG_EXPLAIN_ONLY
Definition: executor.h:58
bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid)
Definition: execUtils.c:572
ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)
Definition: execMain.c:2244
bool ExecRelationIsTargetRelation ( EState estate,
Index  scanrelid 
)

Definition at line 572 of file execUtils.c.

References EState::es_num_result_relations, EState::es_result_relations, and i.

Referenced by ExecInitBitmapIndexScan(), ExecInitIndexOnlyScan(), ExecInitIndexScan(), and ExecOpenScanRelation().

573 {
574  ResultRelInfo *resultRelInfos;
575  int i;
576 
577  resultRelInfos = estate->es_result_relations;
578  for (i = 0; i < estate->es_num_result_relations; i++)
579  {
580  if (resultRelInfos[i].ri_RangeTableIndex == scanrelid)
581  return true;
582  }
583  return false;
584 }
ResultRelInfo * es_result_relations
Definition: execnodes.h:420
int es_num_result_relations
Definition: execnodes.h:421
int i
int ExecTargetListLength ( List targetlist)

Definition at line 962 of file execUtils.c.

References list_length().

Referenced by ExecTypeFromTLInternal().

963 {
964  /* This used to be more complex, but fjoins are dead */
965  return list_length(targetlist);
966 }
static int list_length(const List *l)
Definition: pg_list.h:89
void FreeExecutorState ( EState estate)

Definition at line 173 of file execUtils.c.

References EState::es_exprcontexts, EState::es_query_cxt, FreeExprContext(), linitial, and MemoryContextDelete().

Referenced by afterTriggerInvokeEvents(), apply_handle_delete(), apply_handle_insert(), apply_handle_update(), ATRewriteTable(), compute_index_stats(), CopyFrom(), EvalPlanQualEnd(), evaluate_expr(), ExecuteQuery(), ExecuteTruncate(), ExplainExecuteQuery(), get_actual_variable_range(), get_qual_for_range(), IndexBuildHeapRangeScan(), IndexCheckExclusion(), operator_predicate_proof(), plpgsql_inline_handler(), plpgsql_xact_cb(), standard_ExecutorEnd(), tuplesort_end(), unique_key_recheck(), validate_index_heapscan(), validateCheckConstraint(), and validateDomainConstraint().

174 {
175  /*
176  * Shut down and free any remaining ExprContexts. We do this explicitly
177  * to ensure that any remaining shutdown callbacks get called (since they
178  * might need to release resources that aren't simply memory within the
179  * per-query memory context).
180  */
181  while (estate->es_exprcontexts)
182  {
183  /*
184  * XXX: seems there ought to be a faster way to implement this than
185  * repeated list_delete(), no?
186  */
188  true);
189  /* FreeExprContext removed the list link for us */
190  }
191 
192  /*
193  * Free the per-query memory context, thereby releasing all working
194  * memory, including the EState node itself.
195  */
197 }
void MemoryContextDelete(MemoryContext context)
Definition: mcxt.c:200
MemoryContext es_query_cxt
Definition: execnodes.h:435
#define linitial(l)
Definition: pg_list.h:110
void FreeExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:344
List * es_exprcontexts
Definition: execnodes.h:448
void FreeExprContext ( ExprContext econtext,
bool  isCommit 
)

Definition at line 344 of file execUtils.c.

References ExprContext::ecxt_estate, ExprContext::ecxt_per_tuple_memory, EState::es_exprcontexts, list_delete_ptr(), MemoryContextDelete(), pfree(), and ShutdownExprContext().

Referenced by ExecEndBitmapIndexScan(), ExecEndIndexOnlyScan(), ExecEndIndexScan(), FreeExecutorState(), plpgsql_destroy_econtext(), and plpgsql_subxact_cb().

345 {
346  EState *estate;
347 
348  /* Call any registered callbacks */
349  ShutdownExprContext(econtext, isCommit);
350  /* And clean up the memory used */
352  /* Unlink self from owning EState, if any */
353  estate = econtext->ecxt_estate;
354  if (estate)
356  econtext);
357  /* And delete the ExprContext node */
358  pfree(econtext);
359 }
void MemoryContextDelete(MemoryContext context)
Definition: mcxt.c:200
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:202
List * list_delete_ptr(List *list, void *datum)
Definition: list.c:590
void pfree(void *pointer)
Definition: mcxt.c:950
struct EState * ecxt_estate
Definition: execnodes.h:224
static void ShutdownExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:754
List * es_exprcontexts
Definition: execnodes.h:448
Datum GetAttributeByName ( HeapTupleHeader  tuple,
const char *  attname,
bool isNull 
)

Definition at line 850 of file execUtils.c.

References tupleDesc::attrs, elog, ERROR, heap_getattr, HeapTupleHeaderGetDatumLength, HeapTupleHeaderGetTypeId, HeapTupleHeaderGetTypMod, i, InvalidAttrNumber, InvalidOid, ItemPointerSetInvalid, lookup_rowtype_tupdesc(), namestrcmp(), tupleDesc::natts, NULL, ReleaseTupleDesc, result, HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, and HeapTupleData::t_tableOid.

Referenced by c_overpaid(), and overpaid().

851 {
852  AttrNumber attrno;
853  Datum result;
854  Oid tupType;
855  int32 tupTypmod;
856  TupleDesc tupDesc;
857  HeapTupleData tmptup;
858  int i;
859 
860  if (attname == NULL)
861  elog(ERROR, "invalid attribute name");
862 
863  if (isNull == NULL)
864  elog(ERROR, "a NULL isNull pointer was passed");
865 
866  if (tuple == NULL)
867  {
868  /* Kinda bogus but compatible with old behavior... */
869  *isNull = true;
870  return (Datum) 0;
871  }
872 
873  tupType = HeapTupleHeaderGetTypeId(tuple);
874  tupTypmod = HeapTupleHeaderGetTypMod(tuple);
875  tupDesc = lookup_rowtype_tupdesc(tupType, tupTypmod);
876 
877  attrno = InvalidAttrNumber;
878  for (i = 0; i < tupDesc->natts; i++)
879  {
880  if (namestrcmp(&(tupDesc->attrs[i]->attname), attname) == 0)
881  {
882  attrno = tupDesc->attrs[i]->attnum;
883  break;
884  }
885  }
886 
887  if (attrno == InvalidAttrNumber)
888  elog(ERROR, "attribute \"%s\" does not exist", attname);
889 
890  /*
891  * heap_getattr needs a HeapTuple not a bare HeapTupleHeader. We set all
892  * the fields in the struct just in case user tries to inspect system
893  * columns.
894  */
895  tmptup.t_len = HeapTupleHeaderGetDatumLength(tuple);
896  ItemPointerSetInvalid(&(tmptup.t_self));
897  tmptup.t_tableOid = InvalidOid;
898  tmptup.t_data = tuple;
899 
900  result = heap_getattr(&tmptup,
901  attrno,
902  tupDesc,
903  isNull);
904 
905  ReleaseTupleDesc(tupDesc);
906 
907  return result;
908 }
TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod)
Definition: typcache.c:1257
Form_pg_attribute * attrs
Definition: tupdesc.h:74
int namestrcmp(Name name, const char *str)
Definition: name.c:248
return result
Definition: formatting.c:1618
unsigned int Oid
Definition: postgres_ext.h:31
int natts
Definition: tupdesc.h:73
signed int int32
Definition: c.h:256
HeapTupleHeader t_data
Definition: htup.h:67
#define HeapTupleHeaderGetTypMod(tup)
Definition: htup_details.h:455
#define ERROR
Definition: elog.h:43
ItemPointerData t_self
Definition: htup.h:65
uint32 t_len
Definition: htup.h:64
Oid t_tableOid
Definition: htup.h:66
#define heap_getattr(tup, attnum, tupleDesc, isnull)
Definition: htup_details.h:769
uintptr_t Datum
Definition: postgres.h:372
#define HeapTupleHeaderGetTypeId(tup)
Definition: htup_details.h:445
#define InvalidOid
Definition: postgres_ext.h:36
#define NULL
Definition: c.h:229
#define InvalidAttrNumber
Definition: attnum.h:23
#define ItemPointerSetInvalid(pointer)
Definition: itemptr.h:131
int i
#define elog
Definition: elog.h:219
#define ReleaseTupleDesc(tupdesc)
Definition: tupdesc.h:107
int16 AttrNumber
Definition: attnum.h:21
#define HeapTupleHeaderGetDatumLength(tup)
Definition: htup_details.h:439
Datum GetAttributeByNum ( HeapTupleHeader  tuple,
AttrNumber  attrno,
bool isNull 
)

Definition at line 911 of file execUtils.c.

References AttributeNumberIsValid, elog, ERROR, heap_getattr, HeapTupleHeaderGetDatumLength, HeapTupleHeaderGetTypeId, HeapTupleHeaderGetTypMod, InvalidOid, ItemPointerSetInvalid, lookup_rowtype_tupdesc(), NULL, ReleaseTupleDesc, result, HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, and HeapTupleData::t_tableOid.

914 {
915  Datum result;
916  Oid tupType;
917  int32 tupTypmod;
918  TupleDesc tupDesc;
919  HeapTupleData tmptup;
920 
921  if (!AttributeNumberIsValid(attrno))
922  elog(ERROR, "invalid attribute number %d", attrno);
923 
924  if (isNull == NULL)
925  elog(ERROR, "a NULL isNull pointer was passed");
926 
927  if (tuple == NULL)
928  {
929  /* Kinda bogus but compatible with old behavior... */
930  *isNull = true;
931  return (Datum) 0;
932  }
933 
934  tupType = HeapTupleHeaderGetTypeId(tuple);
935  tupTypmod = HeapTupleHeaderGetTypMod(tuple);
936  tupDesc = lookup_rowtype_tupdesc(tupType, tupTypmod);
937 
938  /*
939  * heap_getattr needs a HeapTuple not a bare HeapTupleHeader. We set all
940  * the fields in the struct just in case user tries to inspect system
941  * columns.
942  */
943  tmptup.t_len = HeapTupleHeaderGetDatumLength(tuple);
944  ItemPointerSetInvalid(&(tmptup.t_self));
945  tmptup.t_tableOid = InvalidOid;
946  tmptup.t_data = tuple;
947 
948  result = heap_getattr(&tmptup,
949  attrno,
950  tupDesc,
951  isNull);
952 
953  ReleaseTupleDesc(tupDesc);
954 
955  return result;
956 }
TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod)
Definition: typcache.c:1257
return result
Definition: formatting.c:1618
unsigned int Oid
Definition: postgres_ext.h:31
signed int int32
Definition: c.h:256
HeapTupleHeader t_data
Definition: htup.h:67
#define HeapTupleHeaderGetTypMod(tup)
Definition: htup_details.h:455
#define ERROR
Definition: elog.h:43
ItemPointerData t_self
Definition: htup.h:65
uint32 t_len
Definition: htup.h:64
Oid t_tableOid
Definition: htup.h:66
#define heap_getattr(tup, attnum, tupleDesc, isnull)
Definition: htup_details.h:769
#define AttributeNumberIsValid(attributeNumber)
Definition: attnum.h:34
uintptr_t Datum
Definition: postgres.h:372
#define HeapTupleHeaderGetTypeId(tup)
Definition: htup_details.h:445
#define InvalidOid
Definition: postgres_ext.h:36
#define NULL
Definition: c.h:229
#define ItemPointerSetInvalid(pointer)
Definition: itemptr.h:131
#define elog
Definition: elog.h:219
#define ReleaseTupleDesc(tupdesc)
Definition: tupdesc.h:107
#define HeapTupleHeaderGetDatumLength(tup)
Definition: htup_details.h:439
ExprContext* MakePerTupleExprContext ( EState estate)

Definition at line 386 of file execUtils.c.

References CreateExprContext(), EState::es_per_tuple_exprcontext, and NULL.

387 {
388  if (estate->es_per_tuple_exprcontext == NULL)
390 
391  return estate->es_per_tuple_exprcontext;
392 }
ExprContext * es_per_tuple_exprcontext
Definition: execnodes.h:459
#define NULL
Definition: c.h:229
ExprContext * CreateExprContext(EState *estate)
Definition: execUtils.c:213
void RegisterExprContextCallback ( ExprContext econtext,
ExprContextCallbackFunction  function,
Datum  arg 
)

Definition at line 697 of file execUtils.c.

References arg, ExprContext_CB::arg, ExprContext::ecxt_callbacks, ExprContext::ecxt_per_query_memory, ExprContext_CB::function, MemoryContextAlloc(), and ExprContext_CB::next.

Referenced by AggRegisterCallback(), ExecMakeFunctionResultSet(), ExecPrepareTuplestoreResult(), fmgr_sql(), get_cached_rowtype(), and init_MultiFuncCall().

700 {
701  ExprContext_CB *ecxt_callback;
702 
703  /* Save the info in appropriate memory context */
704  ecxt_callback = (ExprContext_CB *)
706  sizeof(ExprContext_CB));
707 
708  ecxt_callback->function = function;
709  ecxt_callback->arg = arg;
710 
711  /* link to front of list for appropriate execution order */
712  ecxt_callback->next = econtext->ecxt_callbacks;
713  econtext->ecxt_callbacks = ecxt_callback;
714 }
ExprContextCallbackFunction function
Definition: execnodes.h:164
ExprContext_CB * ecxt_callbacks
Definition: execnodes.h:227
struct ExprContext_CB * next
Definition: execnodes.h:163
MemoryContext ecxt_per_query_memory
Definition: execnodes.h:201
void * MemoryContextAlloc(MemoryContext context, Size size)
Definition: mcxt.c:707
void * arg
void ReScanExprContext ( ExprContext econtext)

Definition at line 371 of file execUtils.c.

References ExprContext::ecxt_per_tuple_memory, MemoryContextReset(), and ShutdownExprContext().

Referenced by agg_retrieve_direct(), domain_check_input(), ExecEndAgg(), ExecReScan(), ExecReScanAgg(), and ValuesNext().

372 {
373  /* Call any registered callbacks */
374  ShutdownExprContext(econtext, true);
375  /* And clean up the memory used */
377 }
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:202
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:135
static void ShutdownExprContext(ExprContext *econtext, bool isCommit)
Definition: execUtils.c:754
static void ShutdownExprContext ( ExprContext econtext,
bool  isCommit 
)
static

Definition at line 754 of file execUtils.c.

References ExprContext_CB::arg, ExprContext::ecxt_callbacks, ExprContext::ecxt_per_tuple_memory, ExprContext_CB::function, MemoryContextSwitchTo(), ExprContext_CB::next, NULL, and pfree().

Referenced by FreeExprContext(), and ReScanExprContext().

755 {
756  ExprContext_CB *ecxt_callback;
757  MemoryContext oldcontext;
758 
759  /* Fast path in normal case where there's nothing to do. */
760  if (econtext->ecxt_callbacks == NULL)
761  return;
762 
763  /*
764  * Call the callbacks in econtext's per-tuple context. This ensures that
765  * any memory they might leak will get cleaned up.
766  */
767  oldcontext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
768 
769  /*
770  * Call each callback function in reverse registration order.
771  */
772  while ((ecxt_callback = econtext->ecxt_callbacks) != NULL)
773  {
774  econtext->ecxt_callbacks = ecxt_callback->next;
775  if (isCommit)
776  (*ecxt_callback->function) (ecxt_callback->arg);
777  pfree(ecxt_callback);
778  }
779 
780  MemoryContextSwitchTo(oldcontext);
781 }
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:202
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
void pfree(void *pointer)
Definition: mcxt.c:950
ExprContextCallbackFunction function
Definition: execnodes.h:164
ExprContext_CB * ecxt_callbacks
Definition: execnodes.h:227
struct ExprContext_CB * next
Definition: execnodes.h:163
#define NULL
Definition: c.h:229
void UnregisterExprContextCallback ( ExprContext econtext,
ExprContextCallbackFunction  function,
Datum  arg 
)

Definition at line 723 of file execUtils.c.

References ExprContext_CB::arg, ExprContext::ecxt_callbacks, ExprContext_CB::function, ExprContext_CB::next, NULL, and pfree().

Referenced by end_MultiFuncCall(), and fmgr_sql().

726 {
727  ExprContext_CB **prev_callback;
728  ExprContext_CB *ecxt_callback;
729 
730  prev_callback = &econtext->ecxt_callbacks;
731 
732  while ((ecxt_callback = *prev_callback) != NULL)
733  {
734  if (ecxt_callback->function == function && ecxt_callback->arg == arg)
735  {
736  *prev_callback = ecxt_callback->next;
737  pfree(ecxt_callback);
738  }
739  else
740  prev_callback = &ecxt_callback->next;
741  }
742 }
void pfree(void *pointer)
Definition: mcxt.c:950
ExprContextCallbackFunction function
Definition: execnodes.h:164
ExprContext_CB * ecxt_callbacks
Definition: execnodes.h:227
struct ExprContext_CB * next
Definition: execnodes.h:163
#define NULL
Definition: c.h:229
void * arg
void UpdateChangedParamSet ( PlanState node,
Bitmapset newchg 
)

Definition at line 666 of file execUtils.c.

References Plan::allParam, bms_free(), bms_intersect(), bms_is_empty(), bms_join(), PlanState::chgParam, and PlanState::plan.

Referenced by ExecReScan(), ExecReScanAppend(), ExecReScanBitmapAnd(), ExecReScanBitmapOr(), ExecReScanMergeAppend(), and ExecReScanSubqueryScan().

667 {
668  Bitmapset *parmset;
669 
670  /*
671  * The plan node only depends on params listed in its allParam set. Don't
672  * include anything else into its chgParam set.
673  */
674  parmset = bms_intersect(node->plan->allParam, newchg);
675 
676  /*
677  * Keep node->chgParam == NULL if there's not actually any members; this
678  * allows the simplest possible tests in executor node files.
679  */
680  if (!bms_is_empty(parmset))
681  node->chgParam = bms_join(node->chgParam, parmset);
682  else
683  bms_free(parmset);
684 }
Bitmapset * bms_join(Bitmapset *a, Bitmapset *b)
Definition: bitmapset.c:838
Bitmapset * allParam
Definition: plannodes.h:151
Bitmapset * chgParam
Definition: execnodes.h:824
bool bms_is_empty(const Bitmapset *a)
Definition: bitmapset.c:663
Bitmapset * bms_intersect(const Bitmapset *a, const Bitmapset *b)
Definition: bitmapset.c:252
Plan * plan
Definition: execnodes.h:800
void bms_free(Bitmapset *a)
Definition: bitmapset.c:201