Re: targetlist functions part 1 (was [HACKERS] targetlist - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: targetlist functions part 1 (was [HACKERS] targetlist
Date
Msg-id Pine.LNX.4.44.0301211906530.789-100000@localhost.localdomain
Whole thread Raw
In response to Re: targetlist functions part 1 (was [HACKERS] targetlist  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: targetlist functions part 1 (was [HACKERS] targetlist
List pgsql-patches
Tom Lane writes:

> > What concerns me is that we're inserting table-generating
> > syntax elements into the select list, which is where they've never
> > belonged.
>
> Do you see another way to pass non-constant arguments to the
> table-generating function?

SELECT * FROM table1 AS t1, table2 AS t2, func1(t1.col, t2.col) ... ?

That's a syntax that would make sense to me.

With sufficiently blurred vision one might even find SQL99's clause

         <collection derived table> ::=
              UNNEST <left paren> <collection value expression> <right paren>

         <table primary> ::=
                <table or query name> [ [ AS ] <correlation name>
                    [ <left paren> <derived column list> <right paren> ] ]
              | <derived table> [ AS ] <correlation name>
                    [ <left paren> <derived column list> <right paren> ]
              | <lateral derived table> [ AS ] <correlation name>
                    [ <left paren> <derived column list> <right paren> ]
              | <collection derived table> [ AS ] <correlation name>
                    [ <left paren> <derived column list> <right paren> ]
              | <only spec>
                  [ [ AS ] <correlation name>
                    [ <left paren> <derived column list> <right paren> ] ]
              | <left paren> <joined table> <right paren>

applicable.  Or maybe not.

--
Peter Eisentraut   peter_e@gmx.net


pgsql-patches by date:

Previous
From: Jan Wieck
Date:
Subject: Win32 port diff files
Next
From: Tom Lane
Date:
Subject: Re: targetlist functions part 1 (was [HACKERS] targetlist