diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-02-14 21:35:07 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-02-14 21:35:07 +0000 |
commit | 4a66f9dd54694eb4d7ecce2c7e0f0c50dfde88cd (patch) | |
tree | 8810441569d5cf2e29f2a5c2b67ceb91d74deb2d /src/include/parser/parse_relation.h | |
parent | d42d31e78e2f9db73edb0b0ed35cafb1c409bdbf (diff) |
Change scoping of table and join refnames to conform to SQL92: a JOIN
clause with an alias is a <subquery> and therefore hides table references
appearing within it, according to the spec. This is the same as the
preliminary patch I posted to pgsql-patches yesterday, plus some really
grotty code in ruleutils.c to reverse-list a query tree with the correct
alias name depending on context. I'd rather not have done that, but unless
we want to force another initdb for 7.1, there's no other way for now.
Diffstat (limited to 'src/include/parser/parse_relation.h')
-rw-r--r-- | src/include/parser/parse_relation.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index bfdf7e8c2af..274de9e8895 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parse_relation.h,v 1.21 2001/01/24 19:43:27 momjian Exp $ + * $Id: parse_relation.h,v 1.22 2001/02/14 21:35:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,15 +19,11 @@ extern Node *refnameRangeOrJoinEntry(ParseState *pstate, char *refname, int *sublevels_up); -extern RangeTblEntry *refnameRangeTableEntry(ParseState *pstate, - char *refname); -extern int refnameRangeTablePosn(ParseState *pstate, - char *refname, - int *sublevels_up); +extern void checkNameSpaceConflicts(ParseState *pstate, Node *namespace1, + Node *namespace2); extern int RTERangeTablePosn(ParseState *pstate, RangeTblEntry *rte, int *sublevels_up); -extern JoinExpr *scanJoinListForRefname(Node *jtnode, char *refname); extern Node *colnameToVar(ParseState *pstate, char *colname); extern Node *qualifiedNameToVar(ParseState *pstate, char *refname, char *colname, bool implicitRTEOK); @@ -40,7 +36,8 @@ extern RangeTblEntry *addRangeTableEntryForSubquery(ParseState *pstate, Query *subquery, Attr *alias, bool inFromCl); -extern void addRTEtoJoinList(ParseState *pstate, RangeTblEntry *rte); +extern void addRTEtoQuery(ParseState *pstate, RangeTblEntry *rte, + bool addToJoinList, bool addToNameSpace); extern RangeTblEntry *addImplicitRTE(ParseState *pstate, char *relname); extern void expandRTE(ParseState *pstate, RangeTblEntry *rte, List **colnames, List **colvars); |