PostgreSQL Source Code  git master
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * parse_relation.h
4  * prototypes for parse_relation.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/parser/parse_relation.h
11  *
12  *-------------------------------------------------------------------------
13  */
17 #include "parser/parse_node.h"
21  const char *schemaname,
22  const char *refname,
23  int location,
24  int *sublevels_up);
26  const char *refname,
27  Index *ctelevelsup);
28 extern bool scanNameSpaceForENR(ParseState *pstate, const char *refname);
29 extern void checkNameSpaceConflicts(ParseState *pstate, List *namespace1,
30  List *namespace2);
32  int varno,
33  int sublevels_up);
35  int varno,
36  int sublevels_up);
38  int rtelevelsup);
39 extern Node *scanNSItemForColumn(ParseState *pstate, ParseNamespaceItem *nsitem,
40  int sublevels_up, const char *colname,
41  int location);
42 extern Node *colNameToVar(ParseState *pstate, const char *colname, bool localonly,
43  int location);
44 extern void markVarForSelectPriv(ParseState *pstate, Var *var,
45  RangeTblEntry *rte);
46 extern Relation parserOpenTable(ParseState *pstate, const RangeVar *relation,
47  int lockmode);
49  RangeVar *relation,
50  Alias *alias,
51  bool inh,
52  bool inFromCl);
54  Relation rel,
55  int lockmode,
56  Alias *alias,
57  bool inh,
58  bool inFromCl);
60  Query *subquery,
61  Alias *alias,
62  bool lateral,
63  bool inFromCl);
65  List *funcnames,
66  List *funcexprs,
67  List *coldeflists,
68  RangeFunction *rangefunc,
69  bool lateral,
70  bool inFromCl);
72  List *exprs,
73  List *coltypes,
74  List *coltypmods,
75  List *colcollations,
76  Alias *alias,
77  bool lateral,
78  bool inFromCl);
80  TableFunc *tf,
81  Alias *alias,
82  bool lateral,
83  bool inFromCl);
85  List *colnames,
86  ParseNamespaceColumn *nscolumns,
87  JoinType jointype,
88  int nummergedcols,
89  List *aliasvars,
90  List *leftcols,
91  List *rightcols,
92  Alias *alias,
93  bool inFromCl);
95  CommonTableExpr *cte,
96  Index levelsup,
97  RangeVar *rv,
98  bool inFromCl);
100  RangeVar *rv,
101  bool inFromCl);
102 extern bool isLockedRefname(ParseState *pstate, const char *refname);
103 extern void addNSItemToQuery(ParseState *pstate, ParseNamespaceItem *nsitem,
104  bool addToJoinList,
105  bool addToRelNameSpace, bool addToVarNameSpace);
106 extern void errorMissingRTE(ParseState *pstate, RangeVar *relation) pg_attribute_noreturn();
107 extern void errorMissingColumn(ParseState *pstate,
108  const char *relname, const char *colname, int location) pg_attribute_noreturn();
109 extern void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
110  int location, bool include_dropped,
111  List **colnames, List **colvars);
113  int sublevels_up, int location,
114  List **colnames);
115 extern List *expandNSItemAttrs(ParseState *pstate, ParseNamespaceItem *nsitem,
116  int sublevels_up, int location);
117 extern int attnameAttNum(Relation rd, const char *attname, bool sysColOK);
118 extern const NameData *attnumAttName(Relation rd, int attid);
119 extern Oid attnumTypeId(Relation rd, int attid);
120 extern Oid attnumCollationId(Relation rd, int attid);
121 extern bool isQueryUsingTempRelation(Query *query);
123 #endif /* PARSE_RELATION_H */
#define pg_attribute_noreturn()
Definition: c.h:167
List * expandNSItemVars(ParseNamespaceItem *nsitem, int sublevels_up, int location, List **colnames)
CommonTableExpr * GetCTEForRTE(ParseState *pstate, RangeTblEntry *rte, int rtelevelsup)
Relation parserOpenTable(ParseState *pstate, const RangeVar *relation, int lockmode)
Definition: nodes.h:528
Node * scanNSItemForColumn(ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, const char *colname, int location)
NameData relname
Definition: pg_class.h:38
unsigned int Oid
Definition: postgres_ext.h:31
Definition: primnodes.h:181
Node * colNameToVar(ParseState *pstate, const char *colname, bool localonly, int location)
Oid attnumCollationId(Relation rd, int attid)
Definition: nodes.h:695
void addNSItemToQuery(ParseState *pstate, ParseNamespaceItem *nsitem, bool addToJoinList, bool addToRelNameSpace, bool addToVarNameSpace)
ParseNamespaceItem * addRangeTableEntryForCTE(ParseState *pstate, CommonTableExpr *cte, Index levelsup, RangeVar *rv, bool inFromCl)
void errorMissingRTE(ParseState *pstate, RangeVar *relation) pg_attribute_noreturn()
Oid attnumTypeId(Relation rd, int attid)
void checkNameSpaceConflicts(ParseState *pstate, List *namespace1, List *namespace2)
bool isLockedRefname(ParseState *pstate, const char *refname)
int attnameAttNum(Relation rd, const char *attname, bool sysColOK)
NameData attname
Definition: pg_attribute.h:40
Definition: c.h:663
void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up, int location, bool include_dropped, List **colnames, List **colvars)
ParseNamespaceItem * addRangeTableEntryForFunction(ParseState *pstate, List *funcnames, List *funcexprs, List *coldeflists, RangeFunction *rangefunc, bool lateral, bool inFromCl)
ParseNamespaceItem * addRangeTableEntryForRelation(ParseState *pstate, Relation rel, int lockmode, Alias *alias, bool inh, bool inFromCl)
const NameData * attnumAttName(Relation rd, int attid)
ParseNamespaceItem * refnameNamespaceItem(ParseState *pstate, const char *schemaname, const char *refname, int location, int *sublevels_up)
void markVarForSelectPriv(ParseState *pstate, Var *var, RangeTblEntry *rte)
unsigned int Index
Definition: c.h:537
ParseNamespaceItem * GetNSItemByRangeTablePosn(ParseState *pstate, int varno, int sublevels_up)
ParseNamespaceItem * addRangeTableEntryForSubquery(ParseState *pstate, Query *subquery, Alias *alias, bool lateral, bool inFromCl)
CommonTableExpr * scanNameSpaceForCTE(ParseState *pstate, const char *refname, Index *ctelevelsup)
bool isQueryUsingTempRelation(Query *query)
ParseNamespaceItem * addRangeTableEntryForValues(ParseState *pstate, List *exprs, List *coltypes, List *coltypmods, List *colcollations, Alias *alias, bool lateral, bool inFromCl)
ParseNamespaceItem * addRangeTableEntryForENR(ParseState *pstate, RangeVar *rv, bool inFromCl)
ParseNamespaceItem * addRangeTableEntry(ParseState *pstate, RangeVar *relation, Alias *alias, bool inh, bool inFromCl)
List * expandNSItemAttrs(ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, int location)
ParseNamespaceItem * addRangeTableEntryForJoin(ParseState *pstate, List *colnames, ParseNamespaceColumn *nscolumns, JoinType jointype, int nummergedcols, List *aliasvars, List *leftcols, List *rightcols, Alias *alias, bool inFromCl)
ParseNamespaceItem * addRangeTableEntryForTableFunc(ParseState *pstate, TableFunc *tf, Alias *alias, bool lateral, bool inFromCl)
Definition: pg_list.h:50
void errorMissingColumn(ParseState *pstate, const char *relname, const char *colname, int location) pg_attribute_noreturn()
RangeTblEntry * GetRTEByRangeTablePosn(ParseState *pstate, int varno, int sublevels_up)
bool scanNameSpaceForENR(ParseState *pstate, const char *refname)