Re: Re: Table name scope (was Re: [BUGS] Outer joins aren't working with views)
От | Tom Lane |
---|---|
Тема | Re: Re: Table name scope (was Re: [BUGS] Outer joins aren't working with views) |
Дата | |
Msg-id | 11255.977343134@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Re: Table name scope (was Re: [BUGS] Outer joins aren't working with views) (Peter Eisentraut <peter_e@gmx.net>) |
Список | pgsql-hackers |
Peter Eisentraut <peter_e@gmx.net> writes: > ISTM that correlation names aren't allowed after joined tables in the > first place. > <table reference> ::= > <table name> [ [ AS ] <correlation name> > [ <left paren> <derived column list> <right paren> ] ] > | <derived table> [ AS ] <correlation name> > [ <left paren> <derived column list> <right paren> ] > | <joined table> > <joined table> ::= > <cross join> > | <qualified join> > | <left paren> <joined table> <right paren> Keep looking: <derived table> ::= <table subquery> <table subquery> ::= <subquery> <subquery> ::= <left paren> <query expression> <right paren> <query expression> ::= <non-join query expression> | <joined table> So you can writeSELECT A.* FROM (A NATURAL JOIN B) J but inSELECT A.* FROM A NATURAL JOIN B J the J will be taken as an alias for B not for the join. If they allowed an alias clause on an unparenthesized <joined table>, the grammar would be ambiguous... regards, tom lane
В списке pgsql-hackers по дате отправления: