summaryrefslogtreecommitdiff
path: root/src/include/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/parser')
-rw-r--r--src/include/parser/analyze.h2
-rw-r--r--src/include/parser/parse_enr.h22
-rw-r--r--src/include/parser/parse_node.h3
-rw-r--r--src/include/parser/parse_relation.h4
4 files changed, 30 insertions, 1 deletions
diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h
index 17259409a7..9b33ba5dfd 100644
--- a/src/include/parser/analyze.h
+++ b/src/include/parser/analyze.h
@@ -23,7 +23,7 @@ extern PGDLLIMPORT post_parse_analyze_hook_type post_parse_analyze_hook;
extern Query *parse_analyze(RawStmt *parseTree, const char *sourceText,
- Oid *paramTypes, int numParams);
+ Oid *paramTypes, int numParams, QueryEnvironment *queryEnv);
extern Query *parse_analyze_varparams(RawStmt *parseTree, const char *sourceText,
Oid **paramTypes, int *numParams);
diff --git a/src/include/parser/parse_enr.h b/src/include/parser/parse_enr.h
new file mode 100644
index 0000000000..48a7576f2c
--- /dev/null
+++ b/src/include/parser/parse_enr.h
@@ -0,0 +1,22 @@
+/*-------------------------------------------------------------------------
+ *
+ * parse_enr.h
+ * Internal definitions for parser
+ *
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/parser/parse_enr.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PARSE_ENR_H
+#define PARSE_ENR_H
+
+#include "parser/parse_node.h"
+
+extern bool name_matches_visible_ENR(ParseState *pstate, const char *refname);
+extern EphemeralNamedRelationMetadata get_visible_ENR(ParseState *pstate, const char *refname);
+
+#endif /* PARSE_ENR_H */
diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h
index 3a25d9598d..1035bad322 100644
--- a/src/include/parser/parse_node.h
+++ b/src/include/parser/parse_node.h
@@ -15,6 +15,7 @@
#define PARSE_NODE_H
#include "nodes/parsenodes.h"
+#include "utils/queryenvironment.h"
#include "utils/relcache.h"
@@ -188,6 +189,8 @@ struct ParseState
bool p_resolve_unknowns; /* resolve unknown-type SELECT outputs
* as type text */
+ QueryEnvironment *p_queryEnv; /* curr env, incl refs to enclosing env */
+
/* Flags telling about things found in the query: */
bool p_hasAggs;
bool p_hasWindowFuncs;
diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h
index 515c06cfef..2f42cc8ef0 100644
--- a/src/include/parser/parse_relation.h
+++ b/src/include/parser/parse_relation.h
@@ -42,6 +42,7 @@ extern RangeTblEntry *refnameRangeTblEntry(ParseState *pstate,
extern CommonTableExpr *scanNameSpaceForCTE(ParseState *pstate,
const char *refname,
Index *ctelevelsup);
+extern bool scanNameSpaceForENR(ParseState *pstate, const char *refname);
extern void checkNameSpaceConflicts(ParseState *pstate, List *namespace1,
List *namespace2);
extern int RTERangeTablePosn(ParseState *pstate,
@@ -107,6 +108,9 @@ extern RangeTblEntry *addRangeTableEntryForCTE(ParseState *pstate,
Index levelsup,
RangeVar *rv,
bool inFromCl);
+extern RangeTblEntry *addRangeTableEntryForENR(ParseState *pstate,
+ RangeVar *rv,
+ bool inFromCl);
extern bool isLockedRefname(ParseState *pstate, const char *refname);
extern void addRTEtoQuery(ParseState *pstate, RangeTblEntry *rte,
bool addToJoinList,