diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-10-08 01:14:44 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-10-08 01:14:44 +0000 |
commit | 3437286356ec3dcbc5abadf78f2587e845a2d7c8 (patch) | |
tree | a8de47826bdcaa58fe1eb482c698c09dfcf34cfe /src/include/parser/parse_node.h | |
parent | e229998138c086e65afc2d0ebd5983bd39921b37 (diff) | |
download | postgresql-3437286356ec3dcbc5abadf78f2587e845a2d7c8.tar.gz postgresql-3437286356ec3dcbc5abadf78f2587e845a2d7c8.zip |
Modify the parser's error reporting to include a specific hint for the case
of referencing a WITH item that's not yet in scope according to the SQL
spec's semantics. This seems to be an easy error to make, and the bare
"relation doesn't exist" message doesn't lead one's mind in the correct
direction to fix it.
Diffstat (limited to 'src/include/parser/parse_node.h')
-rw-r--r-- | src/include/parser/parse_node.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h index 05817cf51a3..8e0d3c201f2 100644 --- a/src/include/parser/parse_node.h +++ b/src/include/parser/parse_node.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_node.h,v 1.57 2008/10/04 21:56:55 tgl Exp $ + * $PostgreSQL: pgsql/src/include/parser/parse_node.h,v 1.58 2008/10/08 01:14:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -54,6 +54,9 @@ * at the moment. This is different from p_relnamespace because you have * to make an RTE before you can access a CTE. * + * p_future_ctes: list of CommonTableExprs (WITH items) that are not yet + * visible due to scope rules. This is used to help improve error messages. + * * p_paramtypes: an array of p_numparams type OIDs for $n parameter symbols * (zeroth entry in array corresponds to $1). If p_variableparams is true, the * set of param types is not predetermined; in that case, a zero array entry @@ -73,6 +76,7 @@ typedef struct ParseState List *p_relnamespace; /* current namespace for relations */ List *p_varnamespace; /* current namespace for columns */ List *p_ctenamespace; /* current namespace for common table exprs */ + List *p_future_ctes; /* common table exprs not yet in namespace */ Oid *p_paramtypes; /* OIDs of types for $n parameter symbols */ int p_numparams; /* allocated size of p_paramtypes[] */ int p_next_resno; /* next targetlist resno to assign */ |