#include "parser/parse_node.h"
Go to the source code of this file.
Definition at line 2710 of file parse_relation.c.
References lappend(), makeNode, ParseNamespaceItem::p_cols_visible, ParseState::p_joinlist, ParseNamespaceItem::p_lateral_ok, ParseNamespaceItem::p_lateral_only, ParseState::p_namespace, ParseNamespaceItem::p_rel_visible, ParseNamespaceItem::p_rtindex, and RangeTblRef::rtindex.
Referenced by addNSItemForReturning(), AddRelationNewConstraints(), AlterPolicy(), CreatePolicy(), CreateTriggerFiringOn(), DefineRelation(), DoCopy(), setTargetTable(), test_rls_hooks_permissive(), test_rls_hooks_restrictive(), transformAlterTableStmt(), transformIndexStmt(), transformInsertStmt(), transformMergeStmt(), transformOnConflictClause(), transformPartitionSpec(), TransformPubWhereClauses(), transformRuleStmt(), transformSetOperationStmt(), transformStatsStmt(), and transformValuesClause().
Definition at line 1487 of file parse_relation.c.
References AccessShareLock, ACL_SELECT, addRTEPermissionInfo(), Alias::aliasname, Assert(), buildNSItemFromTupleDesc(), buildRelationAliases(), RangeTblEntry::inh, isLockedRefname(), lappend(), list_length(), makeAlias(), makeNode, NIL, NoLock, ParseState::p_rtable, ParseState::p_rteperminfos, parserOpenTable(), RelationData::rd_att, RelationData::rd_rel, RelationGetRelid, RangeVar::relname, RTEPermissionInfo::requiredPerms, RowShareLock, RTE_RELATION, RangeTblEntry::rtekind, and table_close().
Referenced by transformTableEntry().
Definition at line 2332 of file parse_relation.c.
References RangeVar::alias, Alias::aliasname, Assert(), buildNSItemFromLists(), CMD_SELECT, Alias::colnames, Query::commandType, copyObject, RangeTblEntry::ctelevelsup, RangeTblEntry::ctename, CommonTableExpr::ctename, CommonTableExpr::ctequery, ereport, errcode(), errmsg(), ERROR, i, if(), InvalidOid, IsA, lappend(), lappend_int(), lappend_oid(), lfirst, list_copy(), list_length(), RangeVar::location, makeAlias(), makeNode, makeString(), NIL, ParseNamespaceColumn::p_dontexpand, ParseNamespaceItem::p_names, ParseNamespaceItem::p_nscolumns, ParseState::p_rtable, parser_errposition(), Query::returningList, RTE_CTE, and RangeTblEntry::rtekind.
Referenced by getNSItemForSpecialRelationTypes().
Definition at line 2484 of file parse_relation.c.
References RangeVar::alias, Alias::aliasname, Assert(), buildNSItemFromTupleDesc(), buildRelationAliases(), elog, ENR_NAMED_TUPLESTORE, ENRMetadataGetTupDesc(), RangeTblEntry::enrname, EphemeralNamedRelationMetadataData::enrtuples, EphemeralNamedRelationMetadataData::enrtype, ERROR, get_visible_ENR(), InvalidOid, lappend(), lappend_int(), lappend_oid(), list_length(), makeAlias(), makeNode, EphemeralNamedRelationMetadataData::name, TupleDescData::natts, NIL, ParseState::p_rtable, EphemeralNamedRelationMetadataData::reliddesc, RangeVar::relname, RTE_NAMEDTUPLESTORE, RangeTblEntry::rtekind, and TupleDescAttr().
Referenced by getNSItemForSpecialRelationTypes().
Definition at line 1751 of file parse_relation.c.
References RangeFunction::alias, Alias::aliasname, Assert(), buildNSItemFromTupleDesc(), buildRelationAliases(), CheckAttributeNamesTypes(), CHKATYPE_ANYRECORD, chooseScalarFunctionAlias(), ColumnDef::colname, CreateTemplateTupleDesc(), ereport, errcode(), errmsg(), ERROR, exprCollation(), exprLocation(), exprType(), exprTypmod(), format_type_be(), forthree, RangeTblFunction::funcexpr, funcname, RangeTblEntry::funcordinality, RangeTblEntry::functions, get_expr_result_type(), GetColumnDefCollation(), i, InvalidOid, j, lappend(), lappend_int(), lappend_oid(), lfirst, linitial, list_length(), ColumnDef::location, makeAlias(), makeNode, makeString(), MaxHeapAttributeNumber, MaxTupleAttributeNumber, TupleDescData::natts, NIL, RangeFunction::ordinality, ParseState::p_rtable, palloc(), parser_errposition(), pstrdup(), RTE_FUNCTION, RangeTblEntry::rtekind, TypeName::setof, RangeTblEntry::subquery, TupleDescCopyEntry(), TupleDescInitEntry(), TupleDescInitEntryCollation(), TYPEFUNC_COMPOSITE, TYPEFUNC_COMPOSITE_DOMAIN, TYPEFUNC_RECORD, TYPEFUNC_SCALAR, ColumnDef::typeName, and typenameTypeIdAndMod().
Referenced by transformRangeFunction().
Definition at line 2583 of file parse_relation.c.
References Assert(), buildNSItemFromLists(), Alias::colnames, copyObject, TargetEntry::expr, exprCollation(), exprType(), exprTypmod(), lappend(), lappend_int(), lappend_oid(), lfirst, list_length(), makeAlias(), makeNode, makeString(), NIL, ParseState::p_rtable, pstrdup(), RTE_GROUP, and RangeTblEntry::rtekind.
Referenced by parseCheckAggregates().
Definition at line 2233 of file parse_relation.c.
References Alias::aliasname, Assert(), Alias::colnames, copyObject, ereport, errcode(), errmsg(), ERROR, InvalidOid, RangeTblEntry::jointype, lappend(), list_concat(), list_copy_tail(), list_length(), makeAlias(), makeNode, MaxAttrNumber, NIL, ParseNamespaceItem::p_cols_visible, ParseNamespaceItem::p_lateral_ok, ParseNamespaceItem::p_lateral_only, ParseNamespaceItem::p_names, ParseNamespaceItem::p_nscolumns, ParseNamespaceItem::p_perminfo, ParseNamespaceItem::p_rel_visible, ParseNamespaceItem::p_returning_type, ParseState::p_rtable, ParseNamespaceItem::p_rte, ParseNamespaceItem::p_rtindex, palloc(), RTE_JOIN, RangeTblEntry::rtekind, RangeTblEntry::subquery, and VAR_RETURNING_DEFAULT.
Referenced by transformFromClauseItem(), and transformSetOperationStmt().
Definition at line 1584 of file parse_relation.c.
References AccessShareLock, ACL_SELECT, addRTEPermissionInfo(), Alias::aliasname, Assert(), buildNSItemFromTupleDesc(), buildRelationAliases(), CheckRelationLockedByMe(), RangeTblEntry::inh, lappend(), list_length(), makeAlias(), makeNode, NIL, ParseState::p_rtable, ParseState::p_rteperminfos, RelationData::rd_att, RelationData::rd_rel, RelationGetRelationName, RelationGetRelid, RTEPermissionInfo::requiredPerms, RowExclusiveLock, RowShareLock, RTE_RELATION, and RangeTblEntry::rtekind.
Referenced by AddRelationNewConstraints(), AlterPolicy(), copy_table(), CreatePolicy(), CreateTriggerFiringOn(), DefineRelation(), DoCopy(), rewriteTargetView(), setTargetTable(), test_rls_hooks_permissive(), test_rls_hooks_restrictive(), transformAlterTableStmt(), transformIndexStmt(), transformOnConflictClause(), transformPartitionSpec(), TransformPubWhereClauses(), transformRuleStmt(), and transformStatsStmt().
Definition at line 1655 of file parse_relation.c.
References Alias::aliasname, Assert(), buildNSItemFromLists(), Alias::colnames, copyObject, ereport, errcode(), errmsg(), ERROR, TargetEntry::expr, exprCollation(), exprType(), exprTypmod(), lappend(), lappend_int(), lappend_oid(), lfirst, list_length(), makeAlias(), makeNode, makeString(), NIL, ParseNamespaceItem::p_rel_visible, ParseState::p_rtable, pstrdup(), TargetEntry::resno, RTE_SUBQUERY, RangeTblEntry::rtekind, RangeTblEntry::subquery, and Query::targetList.
Referenced by convert_ANY_sublink_to_join(), transformInsertStmt(), transformRangeSubselect(), and transformSetOperationTree().
Definition at line 2066 of file parse_relation.c.
References Alias::aliasname, Assert(), buildNSItemFromLists(), Alias::colnames, copyObject, ereport, errcode(), errmsg(), ERROR, exprLocation(), TableFunc::functype, InvalidOid, lappend(), list_concat(), list_copy_tail(), list_length(), makeAlias(), makeNode, MaxTupleAttributeNumber, NIL, ParseState::p_rtable, parser_errposition(), pstrdup(), RTE_TABLEFUNC, RangeTblEntry::rtekind, RangeTblEntry::subquery, RangeTblEntry::tablefunc, and TFT_XMLTABLE.
Referenced by transformJsonTable(), and transformRangeTableFunc().
Definition at line 2151 of file parse_relation.c.
References Alias::aliasname, Assert(), buildNSItemFromLists(), Alias::colnames, copyObject, ereport, errcode(), errmsg(), ERROR, InvalidOid, lappend(), linitial, list_length(), makeAlias(), makeNode, makeString(), NIL, ParseState::p_rtable, pstrdup(), RTE_VALUES, RangeTblEntry::rtekind, snprintf, RangeTblEntry::subquery, and RangeTblEntry::values_lists.
Referenced by transformValuesClause().
Definition at line 3980 of file parse_relation.c.
References Assert(), RangeTblEntry::inh, RTEPermissionInfo::inh, lappend(), list_length(), makeNode, OidIsValid, and RTEPermissionInfo::relid.
Referenced by add_rte_to_flat_rtable(), addRangeTableEntry(), addRangeTableEntryForRelation(), create_edata_for_relation(), create_estate_for_relation(), plan_cluster_use_sort(), plan_create_index_workers(), and rewriteTargetView().
Definition at line 3589 of file parse_relation.c.
References attname, i, InvalidAttrNumber, namestrcmp(), RelationData::rd_att, RelationGetNumberOfAttributes, specialAttNum(), and TupleDescAttr().
Referenced by checkInsertTargets(), CreateTriggerFiringOn(), do_analyze_rel(), and transformUpdateTargetList().
Definition at line 3639 of file parse_relation.c.
References elog, ERROR, FormData_pg_attribute, TupleDescData::natts, RelationData::rd_att, SystemAttributeDefinition(), and TupleDescAttr().
Referenced by transformFkeyGetPrimaryKey().
Definition at line 3681 of file parse_relation.c.
References elog, ERROR, InvalidOid, TupleDescData::natts, RelationData::rd_att, and TupleDescAttr().
Referenced by transformFkeyGetPrimaryKey().
Definition at line 3661 of file parse_relation.c.
References elog, ERROR, FormData_pg_attribute, TupleDescData::natts, RelationData::rd_att, SystemAttributeDefinition(), and TupleDescAttr().
Referenced by transformAssignedExpr(), and transformFkeyGetPrimaryKey().
Definition at line 442 of file parse_relation.c.
References Alias::aliasname, ereport, errcode(), errmsg(), ERROR, lfirst, ParseNamespaceItem::p_names, ParseNamespaceItem::p_rel_visible, ParseNamespaceItem::p_rte, RTE_RELATION, and RangeTblEntry::rtekind.
Referenced by transformFromClause(), and transformFromClauseItem().
Definition at line 898 of file parse_relation.c.
References check_lateral_ref_ok(), ereport, errcode(), errmsg(), ERROR, lfirst, ParseNamespaceItem::p_cols_visible, ParseState::p_lateral_active, ParseNamespaceItem::p_lateral_only, ParseState::p_namespace, ParseState::parentParseState, parser_errposition(), and scanNSItemForColumn().
Referenced by findTargetlistEntrySQL92(), and transformColumnRef().
Definition at line 3771 of file parse_relation.c.
References ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, list_nth(), parser_errposition(), relname, rte_visible_if_lateral(), rte_visible_if_qualified(), searchRangeTableForCol(), and strVal.
Referenced by transformColumnRef().
Definition at line 3700 of file parse_relation.c.
References ereport, errcode(), ERRCODE_UNDEFINED_TABLE, errdetail(), errhint(), errmsg(), ERROR, RangeVar::location, ParseNamespaceItem::p_rte, parser_errposition(), refnameNamespaceItem(), RangeVar::relname, rte_visible_if_lateral(), and searchRangeTableForRel().
Referenced by ExpandColumnRefStar(), and transformColumnRef().
Definition at line 3292 of file parse_relation.c.
References ACL_SELECT, Assert(), expandNSItemVars(), forboth, label, lappend(), lfirst, makeTargetEntry(), markVarForSelectPriv(), name, NIL, ParseState::p_next_resno, ParseNamespaceItem::p_perminfo, ParseNamespaceItem::p_rte, RTEPermissionInfo::requiredPerms, RTE_RELATION, RangeTblEntry::rtekind, and strVal.
Referenced by ExpandAllTables(), ExpandSingleTable(), and transformValuesClause().
Definition at line 3227 of file parse_relation.c.
References Assert(), Alias::colnames, lappend(), lfirst, Var::location, makeVar(), markNullableIfNeeded(), NIL, ParseNamespaceColumn::p_dontexpand, ParseNamespaceItem::p_names, ParseNamespaceItem::p_nscolumns, ParseNamespaceColumn::p_varattno, ParseNamespaceColumn::p_varattnosyn, ParseNamespaceColumn::p_varcollid, ParseNamespaceColumn::p_varno, ParseNamespaceColumn::p_varnosyn, ParseNamespaceColumn::p_varreturningtype, ParseNamespaceColumn::p_vartype, ParseNamespaceColumn::p_vartypmod, strVal, and Var::varreturningtype.
Referenced by coerce_record_to_complex(), expandNSItemAttrs(), and ExpandSingleTable().
Definition at line 2751 of file parse_relation.c.
References Assert(), attnum, copyObject, elog, ERROR, expandRelation(), expandTupleDesc(), TargetEntry::expr, exprCollation(), exprType(), exprTypmod(), forboth, forthree, RangeTblFunction::funcexpr, RangeTblEntry::funcordinality, RangeTblEntry::functions, get_expr_result_type(), InvalidOid, IsA, label, lappend(), lfirst, lfirst_int, lfirst_oid, list_concat(), list_copy_tail(), list_head(), list_length(), list_nth(), list_truncate(), llast, lnext(), Var::location, makeNullConst(), makeString(), makeVar(), NIL, OidIsValid, pstrdup(), TargetEntry::resno, RTE_CTE, RTE_FUNCTION, RTE_GROUP, RTE_JOIN, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, strVal, RangeTblEntry::subquery, Query::targetList, TYPEFUNC_COMPOSITE, TYPEFUNC_COMPOSITE_DOMAIN, TYPEFUNC_RECORD, TYPEFUNC_SCALAR, Var::varlevelsup, and Var::varreturningtype.
Referenced by build_physical_tlist(), expandRecordVariable(), ReplaceVarFromTargetList(), set_relation_column_names(), and transformWholeRowRef().
Definition at line 565 of file parse_relation.c.
References Assert(), RangeTblEntry::ctelevelsup, RangeTblEntry::ctename, CommonTableExpr::ctename, elog, ERROR, lfirst, ParseState::p_ctenamespace, ParseState::parentParseState, RTE_CTE, and RangeTblEntry::rtekind.
Referenced by expandRecordVariable(), and markTargetListOrigin().
Definition at line 518 of file parse_relation.c.
References Assert(), elog, ERROR, lfirst, ParseState::p_namespace, ParseNamespaceItem::p_rtindex, and ParseState::parentParseState.
Referenced by coerce_record_to_complex(), ExpandRowReference(), ParseComplexProjection(), and transformMergeStmt().
Definition at line 545 of file parse_relation.c.
References Assert(), list_length(), ParseState::p_rtable, ParseState::parentParseState, and rt_fetch.
Referenced by count_rowexpr_columns(), expandRecordVariable(), markTargetListOrigin(), and unknown_attribute().
Definition at line 4009 of file parse_relation.c.
References elog, ERROR, list_length(), list_nth_node, and RTEPermissionInfo::relid.
Referenced by add_rte_to_flat_rtable(), all_rows_selectable(), build_simple_rel(), ExecCheckPermissions(), expand_inherited_rtentry(), get_rel_all_updated_cols(), get_row_security_policies(), GetResultRTEPermissionInfo(), markQueryForLocking(), markRTEForSelectPriv(), rewriteTargetView(), subquery_planner(), and transformLockingClause().
Definition at line 2666 of file parse_relation.c.
References lfirst, LockingClause::lockedRels, NIL, ParseState::p_locked_from_parent, ParseState::p_locking_clause, and RangeVar::relname.
Referenced by addRangeTableEntry(), and transformRangeSubselect().
Definition at line 3930 of file parse_relation.c.
References isQueryUsingTempRelation_walker().
Referenced by DefineView(), and transformCreateTableAsStmt().
Definition at line 1050 of file parse_relation.c.
References bms_union(), if(), list_length(), list_nth(), ParseState::p_nullingrels, ParseState::parentParseState, Var::varlevelsup, and Var::varno.
Referenced by buildVarFromNSColumn(), expandNSItemVars(), scanNSItemForColumn(), and transformWholeRowRef().
Definition at line 1165 of file parse_relation.c.
References Assert(), IsA, markRTEForSelectPriv(), ParseState::parentParseState, Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by expandNSItemAttrs(), ExpandSingleTable(), scanNSItemForColumn(), transformJoinUsingClause(), and transformWholeRowRef().
Definition at line 1435 of file parse_relation.c.
References cancel_parser_errposition_callback(), ereport, errcode(), ERRCODE_UNDEFINED_TABLE, errdetail(), errhint(), errmsg(), ERROR, isFutureCTE(), RangeVar::location, RangeVar::relname, RangeVar::schemaname, setup_parser_errposition_callback(), and table_openrv_extended().
Referenced by addRangeTableEntry(), and setTargetTable().
Definition at line 134 of file parse_relation.c.
References get_relname_relid(), InvalidOid, LookupNamespaceNoError(), OidIsValid, ParseState::parentParseState, scanNameSpaceForRefname(), and scanNameSpaceForRelid().
Referenced by errorMissingRTE(), ExpandColumnRefStar(), transformColumnRef(), and transformReturningClause().
Definition at line 290 of file parse_relation.c.
References CommonTableExpr::ctename, lfirst, ParseState::p_ctenamespace, and ParseState::parentParseState.
Referenced by getNSItemForSpecialRelationTypes(), and searchRangeTableForRel().
Definition at line 343 of file parse_relation.c.
References name_matches_visible_ENR().
Referenced by getNSItemForSpecialRelationTypes(), searchRangeTableForRel(), and setTargetTable().
Definition at line 688 of file parse_relation.c.
References Alias::aliasname, attnum, ereport, errcode(), errmsg(), ERROR, EXPR_KIND_CHECK_CONSTRAINT, EXPR_KIND_GENERATED_COLUMN, EXPR_KIND_MERGE_WHEN, FormData_pg_attribute, InvalidAttrNumber, Var::location, makeVar(), markNullableIfNeeded(), markVarForSelectPriv(), ParseState::p_expr_kind, ParseNamespaceItem::p_names, ParseNamespaceItem::p_nscolumns, ParseNamespaceItem::p_returning_type, ParseNamespaceItem::p_rte, ParseNamespaceItem::p_rtindex, ParseNamespaceColumn::p_varattno, ParseNamespaceColumn::p_varattnosyn, ParseNamespaceColumn::p_varcollid, ParseNamespaceColumn::p_varno, ParseNamespaceColumn::p_varnosyn, ParseNamespaceColumn::p_vartype, ParseNamespaceColumn::p_vartypmod, parser_errposition(), scanRTEForColumn(), SystemAttributeDefinition(), TableOidAttributeNumber, and Var::varreturningtype.
Referenced by colNameToVar(), ParseComplexProjection(), and transformColumnRef().