PostgreSQL Source Code
git master
|
#include "parser/parse_node.h"
Go to the source code of this file.
Functions | |
ParseNamespaceItem * | refnameNamespaceItem (ParseState *pstate, const char *schemaname, const char *refname, int location, int *sublevels_up) |
CommonTableExpr * | scanNameSpaceForCTE (ParseState *pstate, const char *refname, Index *ctelevelsup) |
bool | scanNameSpaceForENR (ParseState *pstate, const char *refname) |
void | checkNameSpaceConflicts (ParseState *pstate, List *namespace1, List *namespace2) |
ParseNamespaceItem * | GetNSItemByRangeTablePosn (ParseState *pstate, int varno, int sublevels_up) |
RangeTblEntry * | GetRTEByRangeTablePosn (ParseState *pstate, int varno, int sublevels_up) |
CommonTableExpr * | GetCTEForRTE (ParseState *pstate, RangeTblEntry *rte, int rtelevelsup) |
Node * | scanNSItemForColumn (ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, const char *colname, int location) |
Node * | colNameToVar (ParseState *pstate, const char *colname, bool localonly, int location) |
void | markNullableIfNeeded (ParseState *pstate, Var *var) |
void | markVarForSelectPriv (ParseState *pstate, Var *var) |
Relation | parserOpenTable (ParseState *pstate, const RangeVar *relation, int lockmode) |
ParseNamespaceItem * | addRangeTableEntry (ParseState *pstate, RangeVar *relation, Alias *alias, bool inh, bool inFromCl) |
ParseNamespaceItem * | addRangeTableEntryForRelation (ParseState *pstate, Relation rel, int lockmode, Alias *alias, bool inh, bool inFromCl) |
ParseNamespaceItem * | addRangeTableEntryForSubquery (ParseState *pstate, Query *subquery, Alias *alias, bool lateral, bool inFromCl) |
ParseNamespaceItem * | addRangeTableEntryForFunction (ParseState *pstate, List *funcnames, List *funcexprs, List *coldeflists, RangeFunction *rangefunc, bool lateral, bool inFromCl) |
ParseNamespaceItem * | addRangeTableEntryForValues (ParseState *pstate, List *exprs, List *coltypes, List *coltypmods, List *colcollations, Alias *alias, bool lateral, bool inFromCl) |
ParseNamespaceItem * | addRangeTableEntryForTableFunc (ParseState *pstate, TableFunc *tf, Alias *alias, bool lateral, bool inFromCl) |
ParseNamespaceItem * | addRangeTableEntryForJoin (ParseState *pstate, List *colnames, ParseNamespaceColumn *nscolumns, JoinType jointype, int nummergedcols, List *aliasvars, List *leftcols, List *rightcols, Alias *join_using_alias, Alias *alias, bool inFromCl) |
ParseNamespaceItem * | addRangeTableEntryForCTE (ParseState *pstate, CommonTableExpr *cte, Index levelsup, RangeVar *rv, bool inFromCl) |
ParseNamespaceItem * | addRangeTableEntryForENR (ParseState *pstate, RangeVar *rv, bool inFromCl) |
ParseNamespaceItem * | addRangeTableEntryForGroup (ParseState *pstate, List *groupClauses) |
RTEPermissionInfo * | addRTEPermissionInfo (List **rteperminfos, RangeTblEntry *rte) |
RTEPermissionInfo * | getRTEPermissionInfo (List *rteperminfos, RangeTblEntry *rte) |
bool | isLockedRefname (ParseState *pstate, const char *refname) |
void | addNSItemToQuery (ParseState *pstate, ParseNamespaceItem *nsitem, bool addToJoinList, bool addToRelNameSpace, bool addToVarNameSpace) |
void | errorMissingRTE (ParseState *pstate, RangeVar *relation) pg_attribute_noreturn() |
void | errorMissingColumn (ParseState *pstate, const char *relname, const char *colname, int location) pg_attribute_noreturn() |
void | expandRTE (RangeTblEntry *rte, int rtindex, int sublevels_up, int location, bool include_dropped, List **colnames, List **colvars) |
List * | expandNSItemVars (ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, int location, List **colnames) |
List * | expandNSItemAttrs (ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, bool require_col_privs, int location) |
int | attnameAttNum (Relation rd, const char *attname, bool sysColOK) |
const NameData * | attnumAttName (Relation rd, int attid) |
Oid | attnumTypeId (Relation rd, int attid) |
Oid | attnumCollationId (Relation rd, int attid) |
bool | isQueryUsingTempRelation (Query *query) |
void addNSItemToQuery | ( | ParseState * | pstate, |
ParseNamespaceItem * | nsitem, | ||
bool | addToJoinList, | ||
bool | addToRelNameSpace, | ||
bool | addToVarNameSpace | ||
) |
Definition at line 2692 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 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().
ParseNamespaceItem* addRangeTableEntry | ( | ParseState * | pstate, |
RangeVar * | relation, | ||
Alias * | alias, | ||
bool | inh, | ||
bool | inFromCl | ||
) |
Definition at line 1470 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, RangeTblEntry::relid, RangeVar::relname, RTEPermissionInfo::requiredPerms, RowShareLock, RTE_RELATION, RangeTblEntry::rtekind, and table_close().
Referenced by transformTableEntry().
ParseNamespaceItem* addRangeTableEntryForCTE | ( | ParseState * | pstate, |
CommonTableExpr * | cte, | ||
Index | levelsup, | ||
RangeVar * | rv, | ||
bool | inFromCl | ||
) |
Definition at line 2314 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().
ParseNamespaceItem* addRangeTableEntryForENR | ( | ParseState * | pstate, |
RangeVar * | rv, | ||
bool | inFromCl | ||
) |
Definition at line 2466 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, RangeTblEntry::relid, EphemeralNamedRelationMetadataData::reliddesc, RangeVar::relname, RTE_NAMEDTUPLESTORE, RangeTblEntry::rtekind, and TupleDescAttr.
Referenced by getNSItemForSpecialRelationTypes().
ParseNamespaceItem* addRangeTableEntryForFunction | ( | ParseState * | pstate, |
List * | funcnames, | ||
List * | funcexprs, | ||
List * | coldeflists, | ||
RangeFunction * | rangefunc, | ||
bool | lateral, | ||
bool | inFromCl | ||
) |
Definition at line 1734 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(), RangeTblEntry::relid, 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().
ParseNamespaceItem* addRangeTableEntryForGroup | ( | ParseState * | pstate, |
List * | groupClauses | ||
) |
Definition at line 2565 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().
ParseNamespaceItem* addRangeTableEntryForJoin | ( | ParseState * | pstate, |
List * | colnames, | ||
ParseNamespaceColumn * | nscolumns, | ||
JoinType | jointype, | ||
int | nummergedcols, | ||
List * | aliasvars, | ||
List * | leftcols, | ||
List * | rightcols, | ||
Alias * | join_using_alias, | ||
Alias * | alias, | ||
bool | inFromCl | ||
) |
Definition at line 2216 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, ParseState::p_rtable, ParseNamespaceItem::p_rte, ParseNamespaceItem::p_rtindex, palloc(), RangeTblEntry::relid, RTE_JOIN, RangeTblEntry::rtekind, and RangeTblEntry::subquery.
Referenced by transformFromClauseItem(), and transformSetOperationStmt().
ParseNamespaceItem* addRangeTableEntryForRelation | ( | ParseState * | pstate, |
Relation | rel, | ||
int | lockmode, | ||
Alias * | alias, | ||
bool | inh, | ||
bool | inFromCl | ||
) |
Definition at line 1567 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, RangeTblEntry::relid, 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().
ParseNamespaceItem* addRangeTableEntryForSubquery | ( | ParseState * | pstate, |
Query * | subquery, | ||
Alias * | alias, | ||
bool | lateral, | ||
bool | inFromCl | ||
) |
Definition at line 1638 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().
ParseNamespaceItem* addRangeTableEntryForTableFunc | ( | ParseState * | pstate, |
TableFunc * | tf, | ||
Alias * | alias, | ||
bool | lateral, | ||
bool | inFromCl | ||
) |
Definition at line 2049 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(), RangeTblEntry::relid, RTE_TABLEFUNC, RangeTblEntry::rtekind, RangeTblEntry::subquery, RangeTblEntry::tablefunc, and TFT_XMLTABLE.
Referenced by transformJsonTable(), and transformRangeTableFunc().
ParseNamespaceItem* addRangeTableEntryForValues | ( | ParseState * | pstate, |
List * | exprs, | ||
List * | coltypes, | ||
List * | coltypmods, | ||
List * | colcollations, | ||
Alias * | alias, | ||
bool | lateral, | ||
bool | inFromCl | ||
) |
Definition at line 2134 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(), RangeTblEntry::relid, RTE_VALUES, RangeTblEntry::rtekind, snprintf, RangeTblEntry::subquery, and RangeTblEntry::values_lists.
Referenced by transformValuesClause().
RTEPermissionInfo* addRTEPermissionInfo | ( | List ** | rteperminfos, |
RangeTblEntry * | rte | ||
) |
Definition at line 3949 of file parse_relation.c.
References Assert, RangeTblEntry::inh, RTEPermissionInfo::inh, lappend(), list_length(), makeNode, OidIsValid, RangeTblEntry::relid, 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 3558 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 3608 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 3650 of file parse_relation.c.
References elog, ERROR, InvalidOid, TupleDescData::natts, RelationData::rd_att, and TupleDescAttr.
Definition at line 3630 of file parse_relation.c.
References elog, ERROR, FormData_pg_attribute, TupleDescData::natts, RelationData::rd_att, SystemAttributeDefinition(), and TupleDescAttr.
Referenced by transformAssignedExpr(), and transformFkeyGetPrimaryKey().
void checkNameSpaceConflicts | ( | ParseState * | pstate, |
List * | namespace1, | ||
List * | namespace2 | ||
) |
Definition at line 434 of file parse_relation.c.
References Alias::aliasname, ereport, errcode(), errmsg(), ERROR, lfirst, ParseNamespaceItem::p_names, ParseNamespaceItem::p_rel_visible, ParseNamespaceItem::p_rte, RangeTblEntry::relid, RTE_RELATION, and RangeTblEntry::rtekind.
Referenced by transformFromClause(), and transformFromClauseItem().
Node* colNameToVar | ( | ParseState * | pstate, |
const char * | colname, | ||
bool | localonly, | ||
int | location | ||
) |
Definition at line 883 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().
void errorMissingColumn | ( | ParseState * | pstate, |
const char * | relname, | ||
const char * | colname, | ||
int | location | ||
) |
Definition at line 3740 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().
void errorMissingRTE | ( | ParseState * | pstate, |
RangeVar * | relation | ||
) |
Definition at line 3669 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().
List* expandNSItemAttrs | ( | ParseState * | pstate, |
ParseNamespaceItem * | nsitem, | ||
int | sublevels_up, | ||
bool | require_col_privs, | ||
int | location | ||
) |
Definition at line 3261 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().
List* expandNSItemVars | ( | ParseState * | pstate, |
ParseNamespaceItem * | nsitem, | ||
int | sublevels_up, | ||
int | location, | ||
List ** | colnames | ||
) |
Definition at line 3197 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_vartype, ParseNamespaceColumn::p_vartypmod, and strVal.
Referenced by coerce_record_to_complex(), expandNSItemAttrs(), and ExpandSingleTable().
void expandRTE | ( | RangeTblEntry * | rte, |
int | rtindex, | ||
int | sublevels_up, | ||
int | location, | ||
bool | include_dropped, | ||
List ** | colnames, | ||
List ** | colvars | ||
) |
Definition at line 2732 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(), RangeTblEntry::relid, 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, and Var::varlevelsup.
Referenced by build_physical_tlist(), expandRecordVariable(), pullup_replace_vars_callback(), ReplaceVarsFromTargetList_callback(), set_relation_column_names(), and transformWholeRowRef().
CommonTableExpr* GetCTEForRTE | ( | ParseState * | pstate, |
RangeTblEntry * | rte, | ||
int | rtelevelsup | ||
) |
Definition at line 557 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().
ParseNamespaceItem* GetNSItemByRangeTablePosn | ( | ParseState * | pstate, |
int | varno, | ||
int | sublevels_up | ||
) |
Definition at line 510 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().
RangeTblEntry* GetRTEByRangeTablePosn | ( | ParseState * | pstate, |
int | varno, | ||
int | sublevels_up | ||
) |
Definition at line 537 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().
RTEPermissionInfo* getRTEPermissionInfo | ( | List * | rteperminfos, |
RangeTblEntry * | rte | ||
) |
Definition at line 3978 of file parse_relation.c.
References elog, ERROR, list_length(), list_nth_node, RangeTblEntry::relid, and RTEPermissionInfo::relid.
Referenced by add_rte_to_flat_rtable(), build_simple_rel(), examine_simple_variable(), ExecCheckPermissions(), expand_inherited_rtentry(), get_rel_all_updated_cols(), get_row_security_policies(), GetResultRTEPermissionInfo(), markQueryForLocking(), markRTEForSelectPriv(), rewriteTargetView(), and transformLockingClause().
bool isLockedRefname | ( | ParseState * | pstate, |
const char * | refname | ||
) |
Definition at line 2648 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 3899 of file parse_relation.c.
References isQueryUsingTempRelation_walker().
Referenced by DefineView(), and transformCreateTableAsStmt().
void markNullableIfNeeded | ( | ParseState * | pstate, |
Var * | var | ||
) |
Definition at line 1035 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().
void markVarForSelectPriv | ( | ParseState * | pstate, |
Var * | var | ||
) |
Definition at line 1150 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().
Relation parserOpenTable | ( | ParseState * | pstate, |
const RangeVar * | relation, | ||
int | lockmode | ||
) |
Definition at line 1418 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().
ParseNamespaceItem* refnameNamespaceItem | ( | ParseState * | pstate, |
const char * | schemaname, | ||
const char * | refname, | ||
int | location, | ||
int * | sublevels_up | ||
) |
Definition at line 129 of file parse_relation.c.
References get_relname_relid(), InvalidOid, LookupNamespaceNoError(), OidIsValid, ParseState::parentParseState, scanNameSpaceForRefname(), and scanNameSpaceForRelid().
Referenced by errorMissingRTE(), ExpandColumnRefStar(), and transformColumnRef().
CommonTableExpr* scanNameSpaceForCTE | ( | ParseState * | pstate, |
const char * | refname, | ||
Index * | ctelevelsup | ||
) |
Definition at line 282 of file parse_relation.c.
References CommonTableExpr::ctename, lfirst, ParseState::p_ctenamespace, and ParseState::parentParseState.
Referenced by getNSItemForSpecialRelationTypes(), and searchRangeTableForRel().
bool scanNameSpaceForENR | ( | ParseState * | pstate, |
const char * | refname | ||
) |
Definition at line 335 of file parse_relation.c.
References name_matches_visible_ENR().
Referenced by getNSItemForSpecialRelationTypes(), searchRangeTableForRel(), and setTargetTable().
Node* scanNSItemForColumn | ( | ParseState * | pstate, |
ParseNamespaceItem * | nsitem, | ||
int | sublevels_up, | ||
const char * | colname, | ||
int | location | ||
) |
Definition at line 680 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_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(), and TableOidAttributeNumber.
Referenced by colNameToVar(), ParseComplexProjection(), and transformColumnRef().