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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Table name scope (was Re: [BUGS] Outer joins aren't working with views)
Дата
Msg-id 21101.977078082@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Table name scope (was Re: [BUGS] Outer joins aren't working with views)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 thatSELECT 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Michael Richards"
Дата:
Сообщение: Re: More Tuple Madness
Следующее
От: Tom Lane
Дата:
Сообщение: Re: More Tuple Madness