Re: [PATCHES] targetlist functions part 1 (was targetlist - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PATCHES] targetlist functions part 1 (was targetlist
Date
Msg-id Pine.LNX.4.44.0301221924180.789-100000@localhost.localdomain
Whole thread Raw
Responses Re: [PATCHES] targetlist functions part 1 (was targetlist
List pgsql-hackers
Tom Lane writes:

> > With sufficiently blurred vision one might even find SQL99's clause
> >          <collection derived table> ::=
> >               UNNEST <left paren> <collection value expression> <right paren>
> > applicable.  Or maybe not.
>
> Hm.  I'm not sure what UNNEST does, but now that you bring SQL99 into
> the picture, what about WITH?  That might solve the problem, because
> (I think) WITH tables are logically determined before the main SELECT
> begins to execute.

The SQL 200x draft defines a new clause TABLE ( <collection value
expression> ) as a possible <table primary>, where the <collection value
expression> is required to be a function call.  At the end this just boils
down to UNNEST, though.  UNNEST is defined in terms of a hairy recursive
join subquery with a LATERAL( ) around it.  LATERAL(subquery) is the same
as just (subquery) except that the scope clauses are different.  So I
think this is probably what we ought to look at.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Viacheslav N Tararin
Date:
Subject: WIn32 port
Next
From: Peter Eisentraut
Date:
Subject: Re: Win32 port patches submitted