Re: LATERAL
От | Peter Eisentraut |
---|---|
Тема | Re: LATERAL |
Дата | |
Msg-id | 1252391147.28190.4.camel@vanquo.pezone.net обсуждение исходный текст |
Ответ на | Re: LATERAL (Robert Haas <robertmhaas@gmail.com>) |
Список | pgsql-hackers |
On mån, 2009-09-07 at 19:06 -0400, Robert Haas wrote: > On Mon, Sep 7, 2009 at 3:43 AM, Peter Eisentraut<peter_e@gmx.net> wrote: > > Because joins can be reordered, whereas LATERAL creates a kind of > > syntactic sequence point for join reordering. To pick up your example: > > > >> But this doesn't [work]: > >> > >> select g, h from generate_series(1,10) g, generate_series(1,g) h; > > > > You need to constrain the order of the from items in some way so the "g" > > refers to something well-defined. That's what LATERAL does. > > I don't think so. All joins constrain the join order, I carefully did not say "constrain the join order" but "constraint the order of the from items" and "a *syntactic* sequence point". If the order of the from items is free, then you could also write the above example as select g, h from generate_series(1,g) h, generate_series(1,10) g; but that would no longer be valid with LATERAL in there. > but none of > them except FULL JOIN constrain it completely, and this is no > exception. FWIW, the spec says somewhere that LATERAL is not allowed at or near an outer join. I'll have to read up on it again.
В списке pgsql-hackers по дате отправления: