1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

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.
This commit is contained in:
Tom Lane
2001-02-14 21:35:07 +00:00
parent d42d31e78e
commit 4a66f9dd54
16 changed files with 853 additions and 501 deletions

View File

@@ -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_clause.h,v 1.22 2001/01/24 19:43:27 momjian Exp $
* $Id: parse_clause.h,v 1.23 2001/02/14 21:35:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,10 +16,9 @@
#include "parser/parse_node.h"
extern void makeRangeTable(ParseState *pstate, List *frmList);
extern void lockTargetTable(ParseState *pstate, char *relname);
extern void setTargetTable(ParseState *pstate, char *relname,
bool inh, bool inJoinSet);
extern void transformFromClause(ParseState *pstate, List *frmList);
extern int setTargetTable(ParseState *pstate, char *relname,
bool inh, bool alsoSource);
extern bool interpretInhOption(InhOption inhOpt);
extern Node *transformWhereClause(ParseState *pstate, Node *where);
extern List *transformGroupClause(ParseState *pstate, List *grouplist,