Re: LATERAL

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: LATERAL
Date: 2009-09-08 01:12:17
Message-ID: 20090908011217.GF17756@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert,

* Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
> On Mon, Sep 7, 2009 at 7:47 PM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Because as often as not, they're mistakes.  Please don't think
> > you're smarter than the spec here.
>
> You're frequently the first to criticize the spec, but I have no
> interest in second-guessing whatever behavior the spec specifies for
> this construct.

I'm not entirely sure you followed what Tom was getting at here. If you
did, feel free to ignore me.

> I'm just trying to understand it, and as far as I can
> tell, LATERAL() is just a piece of syntactic sugar that allows
> expressions within to reference FROM items at the same query level.

What I'm gathering is that this may be correct, though I don't know for
sure. The point I think Tom was making is that even if it *is* just
syntactic sugar, we don't want to allow expressions to reference FROM
items at the same query level *unless* LATERAL is specified. Your
earlier comments sounded like you would want to implement allowing
expressions to refer to FROM items at the same query level without
LATERAL being specified.

> I haven't got a copy of the spec, so that's a bit of a handicap. If
> someone who does can look this up and comment on how it's supposed to
> work, I would certainly appreciate that. My understanding of it is
> currently based on random articles cherry-picked around the Internet
> and a handful of emails from archives.postgresql.org, which seems a
> little thin.

You can get a 'draft' that's very close to the spec pretty easily..
Just do '??sql' in IRC sometime..

Enjoy,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-09-08 01:29:59 Re: LATERAL
Previous Message Alvaro Herrera 2009-09-08 00:58:33 Re: LATERAL