1
/*-------------------------------------------------------------------------
4
* Internal definitions for parser
7
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
10
* $PostgreSQL: pgsql/src/include/parser/parse_node.h,v 1.42 2004-12-31 22:03:38 pgsql Exp $
12
*-------------------------------------------------------------------------
17
#include "nodes/parsenodes.h"
18
#include "utils/rel.h"
21
* State information used during parse analysis
23
* p_rtable: list of RTEs that will become the rangetable of the query.
24
* Note that neither relname nor refname of these entries are necessarily
25
* unique; searching the rtable by name is a bad idea.
27
* p_joinlist: list of join items (RangeTblRef and JoinExpr nodes) that
28
* will become the fromlist of the query's top-level FromExpr node.
30
* p_namespace: list of join items that represents the current namespace
31
* for table and column lookup. This may be just a subset of the rtable +
32
* joinlist, and/or may contain entries that are not yet added to the main
33
* joinlist. Note that an RTE that is present in p_namespace, but does not
34
* have its inFromCl flag set, is accessible only with an explicit qualifier;
35
* lookups of unqualified column names should ignore it.
37
* p_paramtypes: an array of p_numparams type OIDs for $n parameter symbols
38
* (zeroth entry in array corresponds to $1). If p_variableparams is true, the
39
* set of param types is not predetermined; in that case, a zero array entry
40
* means that parameter number hasn't been seen, and UNKNOWNOID means the
41
* parameter has been used but its type is not yet known. NOTE: in a stack
42
* of ParseStates, only the topmost ParseState contains paramtype info; but
43
* we copy the p_variableparams flag down to the child nodes for speed in
46
typedef struct ParseState
48
struct ParseState *parentParseState; /* stack link */
49
List *p_rtable; /* range table so far */
50
List *p_joinlist; /* join items so far (will become FromExpr
52
List *p_namespace; /* current lookup namespace (join items) */
53
Oid *p_paramtypes; /* OIDs of types for $n parameter symbols */
54
int p_numparams; /* allocated size of p_paramtypes[] */
55
int p_next_resno; /* next targetlist resno to assign */
56
List *p_forUpdate; /* FOR UPDATE clause, if any (see gram.y) */
57
Node *p_value_substitute; /* what to replace VALUE with, if
59
bool p_variableparams;
64
Relation p_target_relation;
65
RangeTblEntry *p_target_rangetblentry;
68
extern ParseState *make_parsestate(ParseState *parentParseState);
69
extern Var *make_var(ParseState *pstate, RangeTblEntry *rte, int attrno);
70
extern Oid transformArrayType(Oid arrayType);
71
extern ArrayRef *transformArraySubscripts(ParseState *pstate,
78
extern Const *make_const(Value *value);
80
#endif /* PARSE_NODE_H */