Re: WIP patch for LATERAL subqueries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WIP patch for LATERAL subqueries
Дата
Msg-id 10794.1344266738@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WIP patch for LATERAL subqueries  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Aug 6, 2012 at 11:09 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Uh, what exactly?  AFAICT from that blog entry, "x OUTER APPLY y" is
>> exactly the same as "x LEFT JOIN LATERAL y ON true".  Okay, so you
>> saved three words, but is that a good enough reason to invent a
>> nonstandard syntax?

> I wasn't sure that x LEFT JOIN LATERAL (SELECT * FROM y) ON true is
> valid syntax.  I thought that perhaps LATERAL() was only allowed
> around a top-level FROM-list item.

No.  LATERAL is allowed in a <table reference>, which can be either
a top-level FROM item or a component of a JOIN nest.  (My current
patch doesn't actually work for the latter case, but I'm going to
work on fixing that next.)  What's curious about that Sybase blog
is that the blogger seems to think that LATERAL can only be used
at top level ... but I'm not sure if that's actually a restriction
in Sybase, or just a gap in his knowledge.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: tzdata2012d
Следующее
От: Matthias
Дата:
Сообщение: Fwd: Statistics and selectivity estimation for ranges