Re: Bug with view definition?
От | Sebastian Böck |
---|---|
Тема | Re: Bug with view definition? |
Дата | |
Msg-id | 42A717CF.1080901@freenet.de обсуждение исходный текст |
Ответ на | Re: Bug with view definition? (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-general |
Tom Lane wrote: > =?ISO-8859-1?Q?Sebastian_B=F6ck?= <sebastianboeck@freenet.de> writes: > >>why is the last definition of a view not working, although the >>documentation says all three are equal? > > > The documentation says no such thing... So I misinterpreted the following: http://www.postgresql.org/docs/8.0/interactive/queries-table-expressions.html that says: FROM T1 CROSS JOIN T2 is equivalent to FROM T1, T2. It is also equivalent to FROM T1 INNER JOIN T2 ON TRUE > > >>CREATE OR REPLACE VIEW not_working AS >> SELECT one.* >> FROM one.one, two.two >> JOIN join1 ON join1.id = one.id; > > > JOIN binds tighter than comma in FROM-lists, so that means > > FROM one.one CROSS JOIN (two.two JOIN join1 ON join1.id = one.id); > > which of course is illegal because the JOIN/ON condition refers to > something that's not within the current JOIN. Your preceding example > parenthesizes as > > FROM (one.one CROSS JOIN two.two) JOIN join1 ON join1.id = one.id; > > which is OK. Thanks for clarification Sebastian
В списке pgsql-general по дате отправления: