postgresql/src/include/optimizer
Tom Lane 784e762e88 Support multi-argument UNNEST(), and TABLE() syntax for multiple functions.
This patch adds the ability to write TABLE( function1(), function2(), ...)
as a single FROM-clause entry.  The result is the concatenation of the
first row from each function, followed by the second row from each
function, etc; with NULLs inserted if any function produces fewer rows than
others.  This is believed to be a much more useful behavior than what
Postgres currently does with multiple SRFs in a SELECT list.

This syntax also provides a reasonable way to combine use of column
definition lists with WITH ORDINALITY: put the column definition list
inside TABLE(), where it's clear that it doesn't control the ordinality
column as well.

Also implement SQL-compliant multiple-argument UNNEST(), by turning
UNNEST(a,b,c) into TABLE(unnest(a), unnest(b), unnest(c)).

The SQL standard specifies TABLE() with only a single function, not
multiple functions, and it seems to require an implicit UNNEST() which is
not what this patch does.  There may be something wrong with that reading
of the spec, though, because if it's right then the spec's TABLE() is just
a pointless alternative spelling of UNNEST().  After further review of
that, we might choose to adopt a different syntax for what this patch does,
but in any case this functionality seems clearly worthwhile.

Andrew Gierth, reviewed by Zoltán Böszörményi and Heikki Linnakangas, and
significantly revised by me
2013-11-21 19:37:20 -05:00
..
clauses.h Move strip_implicit_coercions() from optimizer to nodeFuncs.c. 2013-07-23 18:21:19 -04:00
cost.h Auto-tune effective_cache size to be 4x shared buffers 2013-10-08 12:12:24 -04:00
geqo.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
geqo_copy.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
geqo_gene.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
geqo_misc.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
geqo_mutation.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
geqo_pool.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
geqo_random.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
geqo_recombination.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
geqo_selection.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
joininfo.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
pathnode.h Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
paths.h Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
placeholder.h Remove ph_may_need from PlaceHolderInfo, with attendant simplifications. 2013-08-14 18:38:47 -04:00
plancat.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
planmain.h Simplify query_planner's API by having it return the top-level RelOptInfo. 2013-08-05 15:01:09 -04:00
planner.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
predtest.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
prep.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
restrictinfo.h Fix planner problems with LATERAL references in PlaceHolderVars. 2013-08-17 20:22:37 -04:00
subselect.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tlist.h In locate_grouping_columns(), don't expect an exact match of Var typmods. 2013-08-23 17:30:53 -04:00
var.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00