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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-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

Browse pgsql-bugs by date

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-12-17 18:36:02 Re: More Tuple Madness
Previous Message Michael Richards 2000-12-17 18:34:35 Re: More Tuple Madness