Skip site navigation (1) Skip section navigation (2)

Re: Table name scope (was Re: Outer joins aren't working with views)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Table name scope (was Re: Outer joins aren't working with views)
Date: 2000-12-17 18:34:42
Message-ID: 21101.977078082@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
I said:
>                  The <select sublist> is equivalent to a <value expression>
>                  sequence in which each <value expression> is a column
>                  reference CR that references a column of TQ that is not
>                  a common column of a <joined table>.

> which is essentially taken from 7.9.4 of the old spec.  This is a mess;

In fact, after looking at it again, I realize that the quoted text is
*wrong*, because it does not say what they presumably intended.  As
written, it appears that
	SELECT J.* FROM (A NATURAL JOIN B) J
should omit the common column(s).  They're common columns of a <joined
table>, aren't they?

A lawyer would probably point out that 7.7 does not define the phrase
"common column".  It defines "common column name".  Common column name
clearly applies to all three tables involved (both input tables and the
output table), but it's not so clear whether "common column" is intended
to do so.

One could also wonder about the intended behavior of multi-level joins.
Does a column of a base table become inaccessible if it is used as a
common column several JOIN levels up?

At best, this part of the spec is extremely poorly written.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-12-17 18:36:02
Subject: Re: More Tuple Madness
Previous:From: Michael RichardsDate: 2000-12-17 18:34:35
Subject: Re: More Tuple Madness

pgsql-bugs by date

Next:From: Thomas LockhartDate: 2000-12-18 02:18:09
Subject: Re: Table name scope (was Re: Outer joins aren't working with views)
Previous:From: Tom LaneDate: 2000-12-17 18:05:48
Subject: Re: Table name scope (was Re: Outer joins aren't working with views)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group