postgresql/src/include/parser
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
..
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
analyze.h Fix crash in error report of invalid tuple lock 2013-08-02 13:18:37 -04:00
gramparse.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
keywords.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
kwlist.h Add SQL Standard WITH ORDINALITY support for UNNEST (and any other SRF) 2013-07-29 16:38:01 +01:00
parse_agg.h Allow aggregate functions to be VARIADIC. 2013-09-03 17:08:46 -04:00
parse_clause.h Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00
parse_coerce.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parse_collate.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parse_cte.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parse_expr.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parse_func.h Move checking an explicit VARIADIC "any" argument into the parser. 2013-07-18 11:52:12 -04:00
parse_node.h Implement the FILTER clause for aggregate function calls. 2013-07-16 20:15:36 -04:00
parse_oper.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parse_param.h Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00
parse_relation.h Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
parse_target.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parse_type.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parse_utilcmd.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parser.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parsetree.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
scanner.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
scansup.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00