1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-17 06:41:09 +03:00

Carry column aliases from the parser frontend. Enables queries like

SELECT a FROM t1 tx (a);
Allow join syntax, including queries like
  SELECT * FROM t1 NATURAL JOIN t2;
Update RTE structure to hold column aliases in an Attr structure.
This commit is contained in:
Thomas G. Lockhart
2000-02-15 03:38:29 +00:00
parent 92c8437d8d
commit a344a6e7b5
27 changed files with 1102 additions and 324 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.35 2000/01/26 05:56:32 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.36 2000/02/15 03:37:09 thomas Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -133,7 +133,7 @@ print_rt(List *rtable)
RangeTblEntry *rte = lfirst(l);
printf("%d\t%s(%s)\t%u\t%d\t%s\n",
i, rte->relname, rte->refname, rte->relid,
i, rte->relname, rte->ref->relname, rte->relid,
rte->inFromCl,
(rte->inh ? "inh" : ""));
i++;
@ -175,8 +175,9 @@ print_expr(Node *expr, List *rtable)
{
rt = rt_fetch(var->varno, rtable);
relname = rt->relname;
if (rt->refname)
relname = rt->refname; /* table renamed */
if (rt->ref)
if (rt->ref->relname)
relname = rt->relname; /* table renamed */
attname = get_attname(rt->relid, var->varattno);
}
break;