From 0ff384f0bcd1a828dc994f02cbbd8bfc3405e94d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 6 Oct 2008 02:12:56 +0000 Subject: Fix the implicit-RTE code to be able to handle implicit RTEs for CTEs, as well as regular tables. Per discussion, this seems necessary to meet the principle of least astonishment. In passing, simplify the error messages in warnAutoRange(). Now that we have parser error position info for these errors, it doesn't seem very useful to word the error message differently depending on whether we are inside a sub-select or not. --- src/include/parser/parse_relation.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/include/parser/parse_relation.h') diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index 9c81d4b50b5..f5212c421b7 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/parser/parse_relation.h,v 1.59 2008/10/04 21:56:55 tgl Exp $ + * $PostgreSQL: pgsql/src/include/parser/parse_relation.h,v 1.60 2008/10/06 02:12:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -23,6 +23,9 @@ extern RangeTblEntry *refnameRangeTblEntry(ParseState *pstate, const char *refname, int location, int *sublevels_up); +extern CommonTableExpr *scanNameSpaceForCTE(ParseState *pstate, + const char *refname, + Index *ctelevelsup); extern void checkNameSpaceConflicts(ParseState *pstate, List *namespace1, List *namespace2); extern int RTERangeTablePosn(ParseState *pstate, -- cgit v1.2.3