PostgreSQL Source Code
git master
|
#include "executor/execdesc.h"
#include "fmgr.h"
#include "nodes/lockoptions.h"
#include "nodes/parsenodes.h"
#include "utils/memutils.h"
Go to the source code of this file.
Data Structures | |
struct | TupOutputState |
Macros | |
#define | EXEC_FLAG_EXPLAIN_ONLY 0x0001 /* EXPLAIN, no ANALYZE */ |
#define | EXEC_FLAG_EXPLAIN_GENERIC 0x0002 /* EXPLAIN (GENERIC_PLAN) */ |
#define | EXEC_FLAG_REWIND 0x0004 /* need efficient rescan */ |
#define | EXEC_FLAG_BACKWARD 0x0008 /* need backward scan */ |
#define | EXEC_FLAG_MARK 0x0010 /* need mark/restore */ |
#define | EXEC_FLAG_SKIP_TRIGGERS 0x0020 /* skip AfterTrigger setup */ |
#define | EXEC_FLAG_WITH_NO_DATA 0x0040 /* REFRESH ... WITH NO DATA */ |
#define | EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot)) |
#define | do_text_output_oneline(tstate, str_to_emit) |
#define | ResetExprContext(econtext) MemoryContextReset((econtext)->ecxt_per_tuple_memory) |
#define | GetPerTupleExprContext(estate) |
#define | GetPerTupleMemoryContext(estate) (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory) |
#define | ResetPerTupleExprContext(estate) |
Typedefs | |
typedef void(* | ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags) |
typedef void(* | ExecutorRun_hook_type) (QueryDesc *queryDesc, ScanDirection direction, uint64 count) |
typedef void(* | ExecutorFinish_hook_type) (QueryDesc *queryDesc) |
typedef void(* | ExecutorEnd_hook_type) (QueryDesc *queryDesc) |
typedef bool(* | ExecutorCheckPerms_hook_type) (List *rangeTable, List *rtePermInfos, bool ereport_on_violation) |
typedef TupleTableSlot *(* | ExecScanAccessMtd) (ScanState *node) |
typedef bool(* | ExecScanRecheckMtd) (ScanState *node, TupleTableSlot *slot) |
typedef struct TupOutputState | TupOutputState |
#define do_text_output_oneline | ( | tstate, | |
str_to_emit | |||
) |
Definition at line 540 of file executor.h.
#define EvalPlanQualSetSlot | ( | epqstate, | |
slot | |||
) | ((epqstate)->origslot = (slot)) |
Definition at line 247 of file executor.h.
#define EXEC_FLAG_BACKWARD 0x0008 /* need backward scan */ |
Definition at line 68 of file executor.h.
#define EXEC_FLAG_EXPLAIN_GENERIC 0x0002 /* EXPLAIN (GENERIC_PLAN) */ |
Definition at line 66 of file executor.h.
#define EXEC_FLAG_EXPLAIN_ONLY 0x0001 /* EXPLAIN, no ANALYZE */ |
Definition at line 65 of file executor.h.
#define EXEC_FLAG_MARK 0x0010 /* need mark/restore */ |
Definition at line 69 of file executor.h.
#define EXEC_FLAG_REWIND 0x0004 /* need efficient rescan */ |
Definition at line 67 of file executor.h.
Definition at line 70 of file executor.h.
#define EXEC_FLAG_WITH_NO_DATA 0x0040 /* REFRESH ... WITH NO DATA */ |
Definition at line 71 of file executor.h.
#define GetPerTupleExprContext | ( | estate | ) |
Definition at line 568 of file executor.h.
#define GetPerTupleMemoryContext | ( | estate | ) | (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory) |
Definition at line 573 of file executor.h.
#define ResetExprContext | ( | econtext | ) | MemoryContextReset((econtext)->ecxt_per_tuple_memory) |
Definition at line 562 of file executor.h.
#define ResetPerTupleExprContext | ( | estate | ) |
Definition at line 577 of file executor.h.
typedef TupleTableSlot*(* ExecScanAccessMtd) (ScanState *node) |
Definition at line 491 of file executor.h.
typedef bool(* ExecScanRecheckMtd) (ScanState *node, TupleTableSlot *slot) |
Definition at line 492 of file executor.h.
typedef bool(* ExecutorCheckPerms_hook_type) (List *rangeTable, List *rtePermInfos, bool ereport_on_violation) |
Definition at line 93 of file executor.h.
typedef void(* ExecutorEnd_hook_type) (QueryDesc *queryDesc) |
Definition at line 89 of file executor.h.
typedef void(* ExecutorFinish_hook_type) (QueryDesc *queryDesc) |
Definition at line 85 of file executor.h.
typedef void(* ExecutorRun_hook_type) (QueryDesc *queryDesc, ScanDirection direction, uint64 count) |
Definition at line 79 of file executor.h.
typedef void(* ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags) |
Definition at line 75 of file executor.h.
typedef struct TupOutputState TupOutputState |
TupOutputState* begin_tup_output_tupdesc | ( | DestReceiver * | dest, |
TupleDesc | tupdesc, | ||
const TupleTableSlotOps * | tts_ops | ||
) |
Definition at line 2342 of file execTuples.c.
References CMD_SELECT, generate_unaccent_rules::dest, TupOutputState::dest, MakeSingleTupleTableSlot(), palloc(), _DestReceiver::rStartup, and TupOutputState::slot.
Referenced by CreateReplicationSlot(), ExecuteCallStmt(), ExplainQuery(), IdentifySystem(), ReadReplicationSlot(), SendTablespaceList(), SendXlogRecPtrResult(), ShowAllGUCConfig(), ShowGUCConfigOption(), and StartReplication().
TupleHashTable BuildTupleHashTable | ( | PlanState * | parent, |
TupleDesc | inputDesc, | ||
int | numCols, | ||
AttrNumber * | keyColIdx, | ||
const Oid * | eqfuncoids, | ||
FmgrInfo * | hashfunctions, | ||
Oid * | collations, | ||
long | nbuckets, | ||
Size | additionalsize, | ||
MemoryContext | tablecxt, | ||
MemoryContext | tempcxt, | ||
bool | use_variable_hash_iv | ||
) |
Definition at line 264 of file execGrouping.c.
References BuildTupleHashTableExt().
TupleHashTable BuildTupleHashTableExt | ( | PlanState * | parent, |
TupleDesc | inputDesc, | ||
int | numCols, | ||
AttrNumber * | keyColIdx, | ||
const Oid * | eqfuncoids, | ||
FmgrInfo * | hashfunctions, | ||
Oid * | collations, | ||
long | nbuckets, | ||
Size | additionalsize, | ||
MemoryContext | metacxt, | ||
MemoryContext | tablecxt, | ||
MemoryContext | tempcxt, | ||
bool | use_variable_hash_iv | ||
) |
Definition at line 155 of file execGrouping.c.
References Assert, CreateStandaloneExprContext(), CreateTupleDescCopy(), TupleHashTableData::cur_eq_func, TupleHashTableData::entrysize, ExecBuildGroupingEqual(), ExecBuildHash32FromAttrs(), TupleHashTableData::exprcontext, get_hash_memory_limit(), TupleHashTableData::hashtab, TupleHashTableData::in_hash_expr, TupleHashTableData::inputslot, TupleHashTableData::keyColIdx, MakeSingleTupleTableSlot(), MemoryContextSwitchTo(), murmurhash32(), TupleHashTableData::numCols, palloc(), ParallelWorkerNumber, TupleHashTableData::tab_collations, TupleHashTableData::tab_eq_func, TupleHashTableData::tab_hash_expr, TupleHashTableData::tablecxt, TupleHashTableData::tableslot, TupleHashTableData::tempcxt, and TTSOpsMinimalTuple.
Referenced by build_hash_table(), buildSubPlanHash(), and BuildTupleHashTable().
void check_exclusion_constraint | ( | Relation | heap, |
Relation | index, | ||
IndexInfo * | indexInfo, | ||
ItemPointer | tupleid, | ||
const Datum * | values, | ||
const bool * | isnull, | ||
EState * | estate, | ||
bool | newIndex | ||
) |
Definition at line 950 of file execIndexing.c.
References CEOUC_WAIT, check_exclusion_or_unique_constraint(), and values.
Referenced by IndexCheckExclusion().
Definition at line 761 of file execReplication.c.
References CMD_DELETE, CMD_UPDATE, PublicationDesc::cols_valid_for_delete, PublicationDesc::cols_valid_for_update, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, PublicationDesc::gencols_valid_for_delete, PublicationDesc::gencols_valid_for_update, OidIsValid, PublicationDesc::pubactions, PublicationActions::pubdelete, PublicationActions::pubupdate, RelationData::rd_rel, RelationBuildPublicationDesc(), RelationGetRelationName, RelationGetReplicaIndex(), PublicationDesc::rf_valid_for_delete, and PublicationDesc::rf_valid_for_update.
Referenced by CheckValidResultRel(), ExecSimpleRelationDelete(), ExecSimpleRelationInsert(), and ExecSimpleRelationUpdate().
void CheckSubscriptionRelkind | ( | char | relkind, |
const char * | nspname, | ||
const char * | relname | ||
) |
Definition at line 871 of file execReplication.c.
References ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, and relname.
Referenced by AlterSubscription_refresh(), apply_handle_tuple_routing(), CreateSubscription(), and logicalrep_rel_open().
void CheckValidResultRel | ( | ResultRelInfo * | resultRelInfo, |
CmdType | operation, | ||
List * | mergeActions | ||
) |
Definition at line 1026 of file execMain.c.
References Assert, CheckCmdReplicaIdentity(), CMD_DELETE, CMD_INSERT, CMD_UPDATE, elog, ereport, errcode(), errmsg(), ERROR, error_view_not_updatable(), FdwRoutine::ExecForeignDelete, FdwRoutine::ExecForeignInsert, FdwRoutine::ExecForeignUpdate, FdwRoutine::IsForeignRelUpdatable, IsInplaceUpdateRelation(), MatViewIncrementalMaintenanceIsEnabled(), RelationData::rd_rel, RelationGetRelationName, ResultRelInfo::ri_FdwRoutine, ResultRelInfo::ri_needLockTagTuple, ResultRelInfo::ri_RelationDesc, and view_has_instead_trigger().
Referenced by CopyFrom(), ExecFindPartition(), ExecInitModifyTable(), and ExecInitPartitionInfo().
EState* CreateExecutorState | ( | void | ) |
Definition at line 88 of file execUtils.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CurrentMemoryContext, EState::es_auxmodifytables, EState::es_crosscheck_snapshot, EState::es_direction, EState::es_exprcontexts, EState::es_finished, EState::es_insert_pending_modifytables, EState::es_insert_pending_result_relations, EState::es_instrument, EState::es_jit, EState::es_jit_flags, EState::es_junkFilter, EState::es_opened_result_relations, EState::es_output_cid, EState::es_parallel_workers_launched, EState::es_parallel_workers_to_launch, 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_queryEnv, EState::es_range_table, EState::es_range_table_size, EState::es_relations, EState::es_result_relations, EState::es_rowmarks, EState::es_rteperminfos, EState::es_snapshot, EState::es_sourceText, EState::es_subplanstates, EState::es_top_eflags, EState::es_total_processed, EState::es_trig_target_relations, EState::es_tuple_routing_result_relations, EState::es_tupleTable, EState::es_use_parallel_mode, ForwardScanDirection, InvalidSnapshot, makeNode, MemoryContextSwitchTo(), and NIL.
Referenced by afterTriggerInvokeEvents(), ATRewriteTable(), check_default_partition_contents(), compute_expr_stats(), compute_index_stats(), CopyFrom(), create_edata_for_relation(), create_estate_for_relation(), EvalPlanQualStart(), evaluate_expr(), ExecuteCallStmt(), ExecuteQuery(), ExecuteTruncateGuts(), ExplainExecuteQuery(), fileIterateForeignScan(), get_qual_for_range(), heapam_index_build_range_scan(), heapam_index_validate_scan(), IndexCheckExclusion(), make_build_data(), operator_predicate_proof(), plpgsql_create_econtext(), plpgsql_inline_handler(), standard_ExecutorStart(), StoreAttrDefault(), tuplesort_begin_cluster(), and validateDomainCheckConstraint().
ExprContext* CreateExprContext | ( | EState * | estate | ) |
Definition at line 306 of file execUtils.c.
References ALLOCSET_DEFAULT_SIZES, and CreateExprContextInternal().
Referenced by ExecAssignExprContext(), ExecInitMergeJoin(), ExecInitSubPlan(), ExecuteCallStmt(), MakePerTupleExprContext(), and plpgsql_create_econtext().
ExprContext* CreateStandaloneExprContext | ( | void | ) |
Definition at line 357 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, and makeNode.
Referenced by BuildTupleHashTableExt(), domain_check_input(), and hypothetical_dense_rank_final().
ExprContext* CreateWorkExprContext | ( | EState * | estate | ) |
Definition at line 321 of file execUtils.c.
References ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE, ALLOCSET_DEFAULT_MINSIZE, CreateExprContextInternal(), and work_mem.
Referenced by ExecInitAgg().
void do_text_output_multiline | ( | TupOutputState * | tstate, |
const char * | txt | ||
) |
Definition at line 2390 of file execTuples.c.
References cstring_to_text_with_len(), DatumGetPointer(), do_tup_output(), len, pfree(), PointerGetDatum(), and values.
Referenced by ExplainQuery().
void do_tup_output | ( | TupOutputState * | tstate, |
const Datum * | values, | ||
const bool * | isnull | ||
) |
Definition at line 2362 of file execTuples.c.
References TupOutputState::dest, ExecClearTuple(), ExecStoreVirtualTuple(), TupleDescData::natts, _DestReceiver::receiveSlot, TupOutputState::slot, TupleTableSlot::tts_isnull, TupleTableSlot::tts_tupleDescriptor, TupleTableSlot::tts_values, and values.
Referenced by CreateReplicationSlot(), do_text_output_multiline(), IdentifySystem(), ReadReplicationSlot(), SendTablespaceList(), SendXlogRecPtrResult(), ShowAllGUCConfig(), and StartReplication().
void end_tup_output | ( | TupOutputState * | tstate | ) |
Definition at line 2420 of file execTuples.c.
References TupOutputState::dest, ExecDropSingleTupleTableSlot(), pfree(), _DestReceiver::rShutdown, and TupOutputState::slot.
Referenced by CreateReplicationSlot(), ExecuteCallStmt(), ExplainQuery(), IdentifySystem(), ReadReplicationSlot(), SendTablespaceList(), SendXlogRecPtrResult(), ShowAllGUCConfig(), ShowGUCConfigOption(), and StartReplication().
TupleTableSlot* EvalPlanQual | ( | EPQState * | epqstate, |
Relation | relation, | ||
Index | rti, | ||
TupleTableSlot * | inputslot | ||
) |
Definition at line 2479 of file execMain.c.
References Assert, EvalPlanQualBegin(), EvalPlanQualNext(), EvalPlanQualSlot(), ExecClearTuple(), ExecCopySlot(), ExecMaterializeSlot(), EPQState::relsubs_blocked, EPQState::relsubs_done, and TupIsNull.
Referenced by ExecDelete(), ExecMergeMatched(), ExecUpdate(), and GetTupleForTrigger().
void EvalPlanQualBegin | ( | EPQState * | epqstate | ) |
Definition at line 2760 of file execMain.c.
References bms_add_member(), PlanState::chgParam, EPQState::epqParam, EState::es_param_exec_vals, EState::es_plannedstmt, EState::es_range_table_size, EvalPlanQualStart(), ExecSetParamPlanMulti(), Plan::extParam, GetPerTupleExprContext, i, ParamExecData::isnull, list_length(), NIL, PlannedStmt::paramExecTypes, EPQState::parentestate, PlanState::plan, EPQState::plan, EPQState::recheckestate, EPQState::recheckplanstate, EPQState::relsubs_blocked, EPQState::relsubs_done, and ParamExecData::value.
Referenced by EvalPlanQual(), ExecDelete(), and ExecLockRows().
void EvalPlanQualEnd | ( | EPQState * | epqstate | ) |
Definition at line 2991 of file execMain.c.
References EState::es_query_cxt, EState::es_range_table_size, EState::es_subplanstates, EState::es_tupleTable, ExecCloseResultRelations(), ExecEndNode(), ExecResetTupleTable(), FreeExecutorState(), lfirst, MemoryContextSwitchTo(), NIL, EPQState::origslot, EPQState::parentestate, EPQState::recheckestate, EPQState::recheckplanstate, EPQState::relsubs_blocked, EPQState::relsubs_done, EPQState::relsubs_rowmark, EPQState::relsubs_slot, and EPQState::tuple_table.
Referenced by apply_handle_delete_internal(), apply_handle_tuple_routing(), apply_handle_update_internal(), EvalPlanQualSetPlan(), ExecEndLockRows(), ExecEndModifyTable(), and ExecLockRows().
bool EvalPlanQualFetchRowMark | ( | EPQState * | epqstate, |
Index | rti, | ||
TupleTableSlot * | slot | ||
) |
Definition at line 2635 of file execMain.c.
References Assert, ExecAuxRowMark::ctidAttNo, DatumGetObjectId(), DatumGetPointer(), elog, ereport, errcode(), errmsg(), ERROR, ExecGetJunkAttribute(), ExecStoreHeapTupleDatum(), GetFdwRoutineForRelation(), ExecRowMark::markType, OidIsValid, EPQState::origslot, ExecRowMark::prti, RelationData::rd_rel, EPQState::recheckestate, FdwRoutine::RefetchForeignRow, ExecRowMark::relation, RelationGetRelationName, ExecRowMark::relid, EPQState::relsubs_rowmark, ROW_MARK_COPY, ROW_MARK_REFERENCE, ExecAuxRowMark::rowmark, RowMarkRequiresRowShareLock, ExecRowMark::rti, SnapshotAny, table_tuple_fetch_row_version(), ExecAuxRowMark::toidAttNo, TupIsNull, and ExecAuxRowMark::wholeAttNo.
Referenced by ExecScanFetch().
void EvalPlanQualInit | ( | EPQState * | epqstate, |
EState * | parentestate, | ||
Plan * | subplan, | ||
List * | auxrowmarks, | ||
int | epqParam, | ||
List * | resultRelations | ||
) |
Definition at line 2548 of file execMain.c.
References EPQState::arowMarks, EPQState::epqParam, EState::es_range_table_size, NIL, EPQState::origslot, palloc0(), EPQState::parentestate, EPQState::plan, EPQState::recheckestate, EPQState::recheckplanstate, EPQState::relsubs_blocked, EPQState::relsubs_done, EPQState::relsubs_rowmark, EPQState::relsubs_slot, EPQState::resultRelations, and EPQState::tuple_table.
Referenced by apply_handle_delete_internal(), apply_handle_tuple_routing(), apply_handle_update_internal(), ExecInitLockRows(), and ExecInitModifyTable().
TupleTableSlot* EvalPlanQualNext | ( | EPQState * | epqstate | ) |
Definition at line 2744 of file execMain.c.
References EState::es_query_cxt, ExecProcNode(), MemoryContextSwitchTo(), EPQState::recheckestate, and EPQState::recheckplanstate.
Referenced by EvalPlanQual(), and ExecLockRows().
Definition at line 2590 of file execMain.c.
References EPQState::arowMarks, EvalPlanQualEnd(), and EPQState::plan.
Referenced by ExecInitModifyTable().
TupleTableSlot* EvalPlanQualSlot | ( | EPQState * | epqstate, |
Relation | relation, | ||
Index | rti | ||
) |
Definition at line 2607 of file execMain.c.
References Assert, EState::es_query_cxt, MemoryContextSwitchTo(), EPQState::parentestate, EPQState::relsubs_slot, table_slot_create(), and EPQState::tuple_table.
Referenced by EvalPlanQual(), ExecDelete(), ExecLockRows(), ExecMergeMatched(), and ExecUpdate().
|
inlinestatic |
Definition at line 605 of file executor.h.
References EState::es_range_table, and list_nth().
Referenced by conversion_error_callback(), ExecEvalWholeRowVar(), ExecGetRangeTableRelation(), ExecInitBitmapIndexScan(), ExecInitIndexOnlyScan(), ExecInitIndexScan(), GetResultRTEPermissionInfo(), InitPlan(), postgresBeginForeignInsert(), postgresBeginForeignModify(), and postgresBeginForeignScan().
Definition at line 485 of file execUtils.c.
References CreateExprContext(), and PlanState::ps_ExprContext.
Referenced by ExecInitAgg(), ExecInitBitmapHeapScan(), ExecInitBitmapIndexScan(), ExecInitCteScan(), ExecInitCustomScan(), ExecInitForeignScan(), ExecInitFunctionScan(), ExecInitGather(), ExecInitGatherMerge(), ExecInitGroup(), ExecInitHash(), ExecInitHashJoin(), ExecInitIndexOnlyScan(), ExecInitIndexScan(), ExecInitInsertProjection(), ExecInitLimit(), ExecInitMemoize(), ExecInitMerge(), ExecInitMergeJoin(), ExecInitModifyTable(), ExecInitNamedTuplestoreScan(), ExecInitNestLoop(), ExecInitPartitionPruning(), ExecInitProjectSet(), ExecInitResult(), ExecInitSampleScan(), ExecInitSeqScan(), ExecInitSetOp(), ExecInitSubqueryScan(), ExecInitTableFuncScan(), ExecInitTidRangeScan(), ExecInitTidScan(), ExecInitUnique(), ExecInitUpdateProjection(), ExecInitValuesScan(), ExecInitWindowAgg(), and ExecInitWorkTableScan().
Definition at line 540 of file execUtils.c.
References ExecBuildProjectionInfo(), PlanState::plan, PlanState::ps_ExprContext, PlanState::ps_ProjInfo, PlanState::ps_ResultTupleSlot, and Plan::targetlist.
Referenced by ExecConditionalAssignProjectionInfo(), ExecInitAgg(), ExecInitGroup(), ExecInitHashJoin(), ExecInitMergeJoin(), ExecInitNestLoop(), ExecInitResult(), and ExecInitWindowAgg().
void ExecAssignScanProjectionInfo | ( | ScanState * | node | ) |
Definition at line 270 of file execScan.c.
References ExecConditionalAssignProjectionInfo(), PlanState::plan, ScanState::ps, Scan::scanrelid, ScanState::ss_ScanTupleSlot, and TupleTableSlot::tts_tupleDescriptor.
Referenced by ExecInitBitmapHeapScan(), ExecInitCteScan(), ExecInitFunctionScan(), ExecInitIndexScan(), ExecInitNamedTuplestoreScan(), ExecInitSampleScan(), ExecInitSeqScan(), ExecInitSubqueryScan(), ExecInitTableFuncScan(), ExecInitTidRangeScan(), ExecInitTidScan(), ExecInitValuesScan(), and ExecWorkTableScan().
void ExecAssignScanProjectionInfoWithVarno | ( | ScanState * | node, |
int | varno | ||
) |
Definition at line 283 of file execScan.c.
References ExecConditionalAssignProjectionInfo(), ScanState::ps, ScanState::ss_ScanTupleSlot, and TupleTableSlot::tts_tupleDescriptor.
Referenced by ExecInitCustomScan(), ExecInitForeignScan(), and ExecInitIndexOnlyScan().
Definition at line 649 of file execUtils.c.
References ExecSetSlotDescriptor(), and ScanState::ss_ScanTupleSlot.
Referenced by ExecWorkTableScan().
ExprState* ExecBuildAggTrans | ( | AggState * | aggstate, |
struct AggStatePerPhaseData * | phase, | ||
bool | doSort, | ||
bool | doHash, | ||
bool | nullcheck | ||
) |
ExecAuxRowMark* ExecBuildAuxRowMark | ( | ExecRowMark * | erm, |
List * | targetlist | ||
) |
Definition at line 2409 of file execMain.c.
References AttributeNumberIsValid, ExecAuxRowMark::ctidAttNo, elog, ERROR, ExecFindJunkAttributeInTlist(), ExecRowMark::markType, palloc0(), ExecRowMark::prti, ROW_MARK_COPY, ExecAuxRowMark::rowmark, ExecRowMark::rowmarkId, ExecRowMark::rti, snprintf, ExecAuxRowMark::toidAttNo, and ExecAuxRowMark::wholeAttNo.
Referenced by ExecInitLockRows(), and ExecInitModifyTable().
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 at line 4321 of file execExpr.c.
References ACL_EXECUTE, aclcheck_error(), ACLCHECK_OK, FunctionCallInfoBaseData::args, Assert, collid, ExprEvalStep::d, EEO_FLAG_IS_QUAL, EEOP_DONE, EEOP_INNER_FETCHSOME, EEOP_INNER_VAR, EEOP_NOT_DISTINCT, EEOP_OUTER_FETCHSOME, EEOP_OUTER_VAR, EEOP_QUAL, ExecComputeSlotInfo(), ExecReadyExpr(), ExprEvalPushStep(), ExprEvalStep::fetch, fmgr_info(), fmgr_info_set_expr, FmgrInfo::fn_addr, ExprEvalStep::func, get_func_name(), GetUserId(), InitFunctionCallInfoData, InvokeFunctionExecuteHook, NullableDatum::isnull, lappend_int(), lfirst_int, makeNode, NIL, object_aclcheck(), OBJECT_FUNCTION, ExprEvalStep::opcode, palloc0(), ExprEvalStep::qualexpr, ExprEvalStep::resnull, ExprEvalStep::resvalue, SizeForFunctionCallInfo, TupleDescAttr, NullableDatum::value, and ExprEvalStep::var.
Referenced by BuildTupleHashTableExt(), ExecInitSubPlan(), and execTuplesMatchPrepare().
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 at line 4156 of file execExpr.c.
References FunctionCallInfoBaseData::args, Assert, ExprEvalStep::d, EEOP_DONE, EEOP_HASHDATUM_FIRST, EEOP_HASHDATUM_FIRST_STRICT, EEOP_HASHDATUM_NEXT32, EEOP_HASHDATUM_NEXT32_STRICT, EEOP_HASHDATUM_SET_INITVAL, ExecCreateExprSetupSteps(), ExecInitExprRec(), ExecReadyExpr(), ExprEvalPushStep(), fmgr_info(), FmgrInfo::fn_addr, forboth, foreach_current_index, ExprEvalStep::hashdatum, ExprEvalStep::hashdatum_initvalue, i, InitFunctionCallInfoData, NullableDatum::isnull, lappend_int(), lfirst, lfirst_int, lfirst_oid, list_length(), makeNode, NIL, ExprEvalStep::opcode, palloc(), palloc0(), ExprEvalStep::resnull, ExprEvalStep::resvalue, SizeForFunctionCallInfo, UInt32GetDatum(), and NullableDatum::value.
Referenced by ExecInitHashJoin().
ExprState* ExecBuildHash32FromAttrs | ( | TupleDesc | desc, |
const TupleTableSlotOps * | ops, | ||
FmgrInfo * | hashfunctions, | ||
Oid * | collations, | ||
int | numCols, | ||
AttrNumber * | keyColIdx, | ||
PlanState * | parent, | ||
uint32 | init_value | ||
) |
Definition at line 3998 of file execExpr.c.
References FunctionCallInfoBaseData::args, Assert, attnum, ExprEvalStep::d, EEOP_DONE, EEOP_HASHDATUM_FIRST, EEOP_HASHDATUM_NEXT32, EEOP_HASHDATUM_SET_INITVAL, EEOP_INNER_FETCHSOME, EEOP_INNER_VAR, ExecComputeSlotInfo(), ExecReadyExpr(), ExprEvalPushStep(), ExprEvalStep::fetch, FmgrInfo::fn_addr, ExprEvalStep::hashdatum, ExprEvalStep::hashdatum_initvalue, i, InitFunctionCallInfoData, NullableDatum::isnull, makeNode, Max, ExprEvalStep::opcode, palloc(), palloc0(), ExprEvalStep::resnull, ExprEvalStep::resvalue, SizeForFunctionCallInfo, TupleDescAttr, UInt32GetDatum(), NullableDatum::value, and ExprEvalStep::var.
Referenced by BuildTupleHashTableExt(), and ExecInitSubPlan().
ExprState* ExecBuildParamSetEqual | ( | TupleDesc | desc, |
const TupleTableSlotOps * | lops, | ||
const TupleTableSlotOps * | rops, | ||
const Oid * | eqfunctions, | ||
const Oid * | collations, | ||
const List * | param_exprs, | ||
PlanState * | parent | ||
) |
Definition at line 4478 of file execExpr.c.
References ACL_EXECUTE, aclcheck_error(), ACLCHECK_OK, FunctionCallInfoBaseData::args, Assert, collid, ExprEvalStep::d, EEO_FLAG_IS_QUAL, EEOP_DONE, EEOP_INNER_FETCHSOME, EEOP_INNER_VAR, EEOP_NOT_DISTINCT, EEOP_OUTER_FETCHSOME, EEOP_OUTER_VAR, EEOP_QUAL, ExecComputeSlotInfo(), ExecReadyExpr(), ExprEvalPushStep(), ExprEvalStep::fetch, fmgr_info(), fmgr_info_set_expr, FmgrInfo::fn_addr, ExprEvalStep::func, get_func_name(), GetUserId(), InitFunctionCallInfoData, InvokeFunctionExecuteHook, NullableDatum::isnull, lappend_int(), lfirst_int, list_length(), makeNode, NIL, object_aclcheck(), OBJECT_FUNCTION, ExprEvalStep::opcode, palloc0(), ExprEvalStep::qualexpr, ExprEvalStep::resnull, ExprEvalStep::resvalue, SizeForFunctionCallInfo, TupleDescAttr, NullableDatum::value, and ExprEvalStep::var.
Referenced by ExecInitMemoize().
ProjectionInfo* ExecBuildProjectionInfo | ( | List * | targetList, |
ExprContext * | econtext, | ||
TupleTableSlot * | slot, | ||
PlanState * | parent, | ||
TupleDesc | inputDesc | ||
) |
Definition at line 365 of file execExpr.c.
References ExprEvalStep::assign_tmp, ExprEvalStep::assign_var, attnum, ExprEvalStep::d, EEOP_ASSIGN_INNER_VAR, EEOP_ASSIGN_OUTER_VAR, EEOP_ASSIGN_SCAN_VAR, EEOP_ASSIGN_TMP, EEOP_ASSIGN_TMP_MAKE_RO, EEOP_DONE, ExecCreateExprSetupSteps(), ExecInitExprRec(), ExecReadyExpr(), TargetEntry::expr, ExprEvalPushStep(), exprType(), get_typlen(), if(), INNER_VAR, IsA, lfirst_node, makeNode, ExprEvalStep::opcode, OUTER_VAR, ProjectionInfo::pi_exprContext, ProjectionInfo::pi_state, TargetEntry::resno, TupleDescAttr, and ExprState::type.
Referenced by ExecAssignProjectionInfo(), ExecInitInsertProjection(), ExecInitMerge(), ExecInitModifyTable(), ExecInitPartitionInfo(), and ExecInitSubPlan().
char* ExecBuildSlotValueDescription | ( | Oid | reloid, |
TupleTableSlot * | slot, | ||
TupleDesc | tupdesc, | ||
Bitmapset * | modifiedCols, | ||
int | maxfieldlen | ||
) |
Definition at line 2223 of file execMain.c.
References ACL_SELECT, ACLCHECK_OK, appendBinaryStringInfo(), appendStringInfoChar(), appendStringInfoString(), bms_is_member(), buf, check_enable_rls(), StringInfoData::data, FirstLowInvalidHeapAttributeNumber, getTypeOutputInfo(), GetUserId(), i, initStringInfo(), InvalidOid, NameStr, TupleDescData::natts, OidOutputFunctionCall(), pg_attribute_aclcheck(), pg_class_aclcheck(), pg_mbcliplen(), RLS_ENABLED, slot_getallattrs(), TupleTableSlot::tts_isnull, TupleTableSlot::tts_values, TupleDescAttr, and val.
Referenced by build_tuple_value_details(), ExecConstraints(), ExecPartitionCheckEmitError(), and ExecWithCheckOptions().
ProjectionInfo* ExecBuildUpdateProjection | ( | List * | targetList, |
bool | evalTargetList, | ||
List * | targetColnos, | ||
TupleDesc | relDesc, | ||
ExprContext * | econtext, | ||
TupleTableSlot * | slot, | ||
PlanState * | parent | ||
) |
Definition at line 525 of file execExpr.c.
References Assert, ExprEvalStep::assign_tmp, ExprEvalStep::assign_var, attnum, bms_add_member(), bms_is_member(), ExprEvalStep::constval, ExprEvalStep::d, EEOP_ASSIGN_OUTER_VAR, EEOP_ASSIGN_SCAN_VAR, EEOP_ASSIGN_TMP, EEOP_CONST, EEOP_DONE, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, ExecInitExprRec(), ExecPushExprSetupSteps(), ExecReadyExpr(), TargetEntry::expr, expr_setup_walker(), ExprEvalPushStep(), exprType(), forboth, format_type_be(), ExprSetupInfo::last_outer, ExprSetupInfo::last_scan, lfirst_int, lfirst_node, list_length(), makeNode, TupleDescData::natts, NIL, ExprEvalStep::opcode, ProjectionInfo::pi_exprContext, ProjectionInfo::pi_state, ExprEvalStep::resnull, ExprEvalStep::resvalue, TupleDescAttr, and ExprState::type.
Referenced by ExecInitMerge(), ExecInitModifyTable(), ExecInitPartitionInfo(), and ExecInitUpdateProjection().
bool ExecCheck | ( | ExprState * | state, |
ExprContext * | econtext | ||
) |
Definition at line 850 of file execExpr.c.
References Assert, DatumGetBool(), EEO_FLAG_IS_QUAL, and ExecEvalExprSwitchContext().
Referenced by ATRewriteTable(), check_default_partition_contents(), domain_check_input(), ExecPartitionCheck(), and ExecRelCheck().
bool ExecCheckIndexConstraints | ( | ResultRelInfo * | resultRelInfo, |
TupleTableSlot * | slot, | ||
EState * | estate, | ||
ItemPointer | conflictTid, | ||
ItemPointer | tupleid, | ||
List * | arbiterIndexes | ||
) |
Definition at line 536 of file execIndexing.c.
References CEOUC_WAIT, check_exclusion_or_unique_constraint(), ExprContext::ecxt_scantuple, elog, ereport, errcode(), errmsg(), ERROR, errtableconstraint(), ExecPrepareQual(), ExecQual(), FormIndexDatum(), GetPerTupleExprContext, i, IndexInfo::ii_ExclusionOps, IndexInfo::ii_Predicate, IndexInfo::ii_PredicateState, IndexInfo::ii_ReadyForInserts, IndexInfo::ii_Unique, INDEX_MAX_KEYS, ItemPointerSetInvalid(), list_member_oid(), NIL, RelationData::rd_index, RelationGetRelationName, ResultRelInfo::ri_IndexRelationDescs, ResultRelInfo::ri_IndexRelationInfo, ResultRelInfo::ri_NumIndices, ResultRelInfo::ri_RelationDesc, and values.
Referenced by ExecInsert(), and FindConflictTuple().
Definition at line 579 of file execMain.c.
References aclcheck_error(), ACLCHECK_NO_PRIV, Assert, bms_add_member(), bms_is_member(), bms_num_members(), ExecCheckOneRelPerms(), ExecutorCheckPerms_hook, get_rel_name(), get_rel_relkind(), get_relkind_objtype(), getRTEPermissionInfo(), lfirst_node, list_length(), OidIsValid, RTEPermissionInfo::relid, RTE_RELATION, RTE_SUBQUERY, and RangeTblEntry::rtekind.
Referenced by DoCopy(), InitPlan(), and RI_Initial_Check().
int ExecCleanTargetListLength | ( | List * | targetlist | ) |
Definition at line 1121 of file execUtils.c.
References len, and lfirst_node.
Referenced by ApplyRetrieveRule(), check_sql_fn_retval(), and ExecTypeFromTLInternal().
Definition at line 2037 of file execTuples.c.
References ExecTypeFromTLInternal().
Referenced by ExecInitJunkFilter(), PlanCacheComputeResultDesc(), and PortalStart().
void ExecCloseIndices | ( | ResultRelInfo * | resultRelInfo | ) |
Definition at line 236 of file execIndexing.c.
References i, index_close(), index_insert_cleanup(), ResultRelInfo::ri_IndexRelationDescs, ResultRelInfo::ri_IndexRelationInfo, ResultRelInfo::ri_NumIndices, and RowExclusiveLock.
Referenced by apply_handle_delete_internal(), apply_handle_insert_internal(), apply_handle_tuple_routing(), apply_handle_update_internal(), CatalogCloseIndexes(), ExecCleanupTupleRouting(), and ExecCloseResultRelations().
void ExecCloseRangeTableRelations | ( | EState * | estate | ) |
Definition at line 1583 of file execMain.c.
References EState::es_range_table_size, EState::es_relations, i, NoLock, and table_close().
Referenced by CopyFrom(), and ExecEndPlan().
void ExecCloseResultRelations | ( | EState * | estate | ) |
Definition at line 1523 of file execMain.c.
References Assert, EState::es_opened_result_relations, EState::es_trig_target_relations, ExecCloseIndices(), lfirst, NoLock, ResultRelInfo::ri_ancestorResultRels, ResultRelInfo::ri_NumIndices, ResultRelInfo::ri_RangeTableIndex, ResultRelInfo::ri_RelationDesc, and table_close().
Referenced by afterTriggerInvokeEvents(), CopyFrom(), EvalPlanQualEnd(), and ExecEndPlan().
Definition at line 560 of file execUtils.c.
References ExecAssignProjectionInfo(), ExecInitResultSlot(), PlanState::plan, PlanState::ps_ProjInfo, PlanState::ps_ResultTupleSlot, PlanState::resultops, PlanState::resultopsfixed, PlanState::resultopsset, PlanState::scanops, PlanState::scanopsfixed, PlanState::scanopsset, Plan::targetlist, tlist_matches_tupdesc(), and TTSOpsVirtual.
Referenced by ExecAssignScanProjectionInfo(), ExecAssignScanProjectionInfoWithVarno(), ExecInitGather(), and ExecInitGatherMerge().
void ExecConstraints | ( | ResultRelInfo * | resultRelInfo, |
TupleTableSlot * | slot, | ||
EState * | estate | ||
) |
Definition at line 1925 of file execMain.c.
References Assert, bms_union(), build_attrmap_by_name_if_req(), TupleDescData::constr, ereport, errcode(), errdetail(), errmsg(), ERROR, errtablecol(), errtableconstraint(), ExecBuildSlotValueDescription(), ExecGetInsertedCols(), ExecGetUpdatedCols(), ExecRelCheck(), execute_attr_map_slot(), TupleConstr::has_not_null, MakeTupleTableSlot(), NameStr, TupleDescData::natts, RelationData::rd_rel, RelationGetDescr, RelationGetRelationName, RelationGetRelid, ResultRelInfo::ri_RelationDesc, ResultRelInfo::ri_RootResultRelInfo, slot_attisnull(), TTSOpsVirtual, and TupleDescAttr.
Referenced by CopyFrom(), ExecInsert(), ExecSimpleRelationInsert(), ExecSimpleRelationUpdate(), and ExecUpdateAct().
void ExecCreateScanSlotFromOuterPlan | ( | EState * | estate, |
ScanState * | scanstate, | ||
const TupleTableSlotOps * | tts_ops | ||
) |
Definition at line 661 of file execUtils.c.
References ExecGetResultType(), ExecInitScanTupleSlot(), outerPlan, and outerPlanState.
Referenced by ExecInitAgg(), ExecInitGroup(), ExecInitIncrementalSort(), ExecInitMaterial(), ExecInitMemoize(), ExecInitSort(), and ExecInitWindowAgg().
bool execCurrentOf | ( | CurrentOfExpr * | cexpr, |
ExprContext * | econtext, | ||
Oid | table_oid, | ||
ItemPointer | current_tid | ||
) |
Definition at line 44 of file execCurrent.c.
References Assert, PortalData::atEnd, PortalData::atStart, ExecRowMark::curCtid, CurrentOfExpr::cursor_name, CurrentOfExpr::cursor_param, DatumGetObjectId(), DatumGetPointer(), elog, ereport, errcode(), errmsg(), ERROR, EState::es_range_table_size, EState::es_rowmarks, QueryDesc::estate, fetch_cursor_param_value(), get_rel_name(), GetPortalByName(), i, IsA, ItemPointerIsValid(), ExecRowMark::markType, QueryDesc::planstate, PORTAL_ONE_SELECT, PortalIsValid, PortalData::queryDesc, ExecRowMark::relid, RowMarkRequiresRowShareLock, search_plan_tree(), SelfItemPointerAttributeNumber, slot_getsysattr(), ScanState::ss_ScanTupleSlot, PortalData::strategy, TableOidAttributeNumber, TupIsNull, and IndexScanDescData::xs_heaptid.
Referenced by TidListEval().
void ExecEndNode | ( | PlanState * | node | ) |
Definition at line 562 of file execProcnode.c.
References bms_free(), check_stack_depth(), PlanState::chgParam, elog, ERROR, ExecEndAgg(), ExecEndAppend(), ExecEndBitmapAnd(), ExecEndBitmapHeapScan(), ExecEndBitmapIndexScan(), ExecEndBitmapOr(), ExecEndCteScan(), ExecEndCustomScan(), ExecEndForeignScan(), ExecEndFunctionScan(), ExecEndGather(), ExecEndGatherMerge(), ExecEndGroup(), ExecEndHash(), ExecEndHashJoin(), ExecEndIncrementalSort(), ExecEndIndexOnlyScan(), ExecEndIndexScan(), ExecEndLimit(), ExecEndLockRows(), ExecEndMaterial(), ExecEndMemoize(), ExecEndMergeAppend(), ExecEndMergeJoin(), ExecEndModifyTable(), ExecEndNestLoop(), ExecEndProjectSet(), ExecEndRecursiveUnion(), ExecEndResult(), ExecEndSampleScan(), ExecEndSeqScan(), ExecEndSetOp(), ExecEndSort(), ExecEndSubqueryScan(), ExecEndTableFuncScan(), ExecEndTidRangeScan(), ExecEndTidScan(), ExecEndUnique(), ExecEndWindowAgg(), and nodeTag.
Referenced by EvalPlanQualEnd(), ExecEndAgg(), ExecEndAppend(), ExecEndBitmapAnd(), ExecEndBitmapHeapScan(), ExecEndBitmapOr(), ExecEndForeignScan(), ExecEndGather(), ExecEndGatherMerge(), ExecEndGroup(), ExecEndHash(), ExecEndHashJoin(), ExecEndIncrementalSort(), ExecEndLimit(), ExecEndLockRows(), ExecEndMaterial(), ExecEndMemoize(), ExecEndMergeAppend(), ExecEndMergeJoin(), ExecEndModifyTable(), ExecEndNestLoop(), ExecEndPlan(), ExecEndProjectSet(), ExecEndRecursiveUnion(), ExecEndResult(), ExecEndSetOp(), ExecEndSort(), ExecEndSubqueryScan(), ExecEndUnique(), and ExecEndWindowAgg().
|
inlinestatic |
Definition at line 351 of file executor.h.
Referenced by advance_windowaggregate(), advance_windowaggregate_base(), array_map(), ATRewriteTable(), do_cast_value(), EvalOrderByExpressions(), exec_eval_simple_expr(), ExecComputeStoredGenerated(), ExecEvalFuncArgs(), ExecIndexEvalArrayKeys(), ExecIndexEvalRuntimeKeys(), ExecMakeTableFunctionResult(), ExecProjectSRF(), finalize_aggregate(), JsonTableGetValue(), JsonTableInitOpaque(), make_build_data(), MJEvalInnerValues(), MJEvalOuterValues(), NextCopyFrom(), prepare_probe_slot(), process_query_params(), slot_fill_defaults(), StoreAttrDefault(), tfuncFetchRows(), tfuncInitialize(), tfuncLoadRows(), TupleHashTableHash_internal(), ValuesNext(), WinGetFuncArgCurrent(), WinGetFuncArgInFrame(), and WinGetFuncArgInPartition().
|
inlinestatic |
Definition at line 366 of file executor.h.
References ExprContext::ecxt_per_tuple_memory, and MemoryContextSwitchTo().
Referenced by advance_aggregates(), calculate_frame_offsets(), compute_expr_stats(), evaluate_expr(), EvaluateParams(), ExecCheck(), ExecHashJoinOuterGetTuple(), ExecParallelHashJoinOuterGetTuple(), ExecParallelHashJoinPartitionOuter(), ExecProject(), ExecQual(), ExecScanSubPlan(), ExecuteCallStmt(), FormIndexDatum(), FormPartitionKeyDatum(), get_qual_for_range(), MultiExecParallelHash(), MultiExecPrivateHash(), operator_predicate_proof(), partkey_datum_from_expr(), pgoutput_row_filter_exec_expr(), recompute_limits(), tablesample_init(), TidListEval(), TidRangeEval(), and validateDomainCheckConstraint().
TupleTableSlot* ExecFilterJunk | ( | JunkFilter * | junkfilter, |
TupleTableSlot * | slot | ||
) |
Definition at line 247 of file execJunk.c.
References ExecClearTuple(), ExecStoreVirtualTuple(), i, j, JunkFilter::jf_cleanMap, JunkFilter::jf_cleanTupType, JunkFilter::jf_resultSlot, TupleDescData::natts, slot_getallattrs(), TupleTableSlot::tts_isnull, TupleTableSlot::tts_values, and values.
Referenced by ExecEvalWholeRowVar(), ExecutePlan(), and sqlfunction_receive().
AttrNumber ExecFindJunkAttribute | ( | JunkFilter * | junkfilter, |
const char * | attrName | ||
) |
Definition at line 210 of file execJunk.c.
References ExecFindJunkAttributeInTlist(), and JunkFilter::jf_targetList.
AttrNumber ExecFindJunkAttributeInTlist | ( | List * | targetlist, |
const char * | attrName | ||
) |
Definition at line 222 of file execJunk.c.