summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_relation.c
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1998-08-18 00:49:04 +0000
committerMarc G. Fournier <scrappy@hub.org>1998-08-18 00:49:04 +0000
commit338c54cbc10ed9ed7f7216f839b9b14e5e42b7db (patch)
treed2f549772ab7e62167c9ed9afd06f96513843889 /src/backend/parser/parse_relation.c
parentfde65267539aa5daa00ed9a674a1a3a42cb0917d (diff)
downloadpostgresql-338c54cbc10ed9ed7f7216f839b9b14e5e42b7db.tar.gz
From: Jan Wieck <jwieck@debis.com>
Hi, as proposed here comes the first patch for the query rewrite system. <for details, see archive dated Mon, 17 Aug 1998>
Diffstat (limited to 'src/backend/parser/parse_relation.c')
-rw-r--r--src/backend/parser/parse_relation.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index fef834d2c6..181152bfa5 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.12 1998/07/08 14:04:11 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.13 1998/08/18 00:48:57 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -191,8 +191,13 @@ addRangeTableEntry(ParseState *pstate,
if (pstate != NULL)
{
if (refnameRangeTablePosn(pstate, refname, &sublevels_up) != 0 &&
- (!inFromCl || sublevels_up == 0))
+ (!inFromCl || sublevels_up == 0)) {
+ if (!strcmp(refname, "*CURRENT*") || !strcmp(refname, "*NEW*")) {
+ int rt_index = refnameRangeTablePosn(pstate, refname, &sublevels_up);
+ return (RangeTblEntry *)nth(rt_index - 1, pstate->p_rtable);
+ }
elog(ERROR, "Table name %s specified more than once", refname);
+ }
}
rte->relname = pstrdup(relname);