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/backend/commands/command.c | |
parent | d42d31e78e2f9db73edb0b0ed35cafb1c409bdbf (diff) | |
download | postgresql-4a66f9dd54694eb4d7ecce2c7e0f0c50dfde88cd.tar.gz postgresql-4a66f9dd54694eb4d7ecce2c7e0f0c50dfde88cd.zip |
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/backend/commands/command.c')
-rw-r--r-- | src/backend/commands/command.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c index 30695a7a90b..8808a03f1ac 100644 --- a/src/backend/commands/command.c +++ b/src/backend/commands/command.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.120 2001/01/29 00:39:20 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.121 2001/02/14 21:35:00 tgl Exp $ * * NOTES * The PerformAddAttribute() code, like most of the relation @@ -1136,10 +1136,9 @@ AlterTableAddConstraint(char *relationName, * the expression we can pass to ExecQual */ pstate = make_parsestate(NULL); - makeRangeTable(pstate, NULL); rte = addRangeTableEntry(pstate, relationName, NULL, false, true); - addRTEtoJoinList(pstate, rte); + addRTEtoQuery(pstate, rte, true, true); /* Convert the A_EXPR in raw_expr into an EXPR */ expr = transformExpr(pstate, constr->raw_expr, |