postgresql/src/backend/utils
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
..
adt Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
cache Fix relfilenodemap.c's handling of cache invalidations. 2013-11-13 10:52:59 -05:00
error Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
fmgr Use appendStringInfoString instead of appendStringInfo where possible. 2013-10-31 10:55:59 -04:00
hash pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
init Remove CTimeZone/HasCTZSet, root and branch. 2013-11-01 13:57:31 -04:00
mb Add checks for valid multibyte character length in UtfToLocal, LocalToUtf. 2013-07-18 21:55:38 -04:00
misc Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
mmgr Get rid of use of asprintf() in favor of a more portable implementation. 2013-10-22 18:42:13 -04:00
resowner Fix details missed by dynamic shared memory patch. 2013-10-14 08:00:26 -04:00
sort Ensure 64bit arithmetic when calculating tapeSpace 2013-07-14 16:26:16 -04:00
time Fix old visibility bug in HeapTupleSatisfiesDirty 2013-08-02 17:02:36 -04:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Update copyrights for 2013 2013-01-01 17:15:01 -05:00
Gen_dummy_probes.sed Update copyrights for 2013 2013-01-01 17:15:01 -05:00
Gen_fmgrtab.pl Update copyrights for 2013 2013-01-01 17:15:01 -05:00
generate-errcodes.pl Update copyrights for 2013 2013-01-01 17:15:01 -05:00
Makefile
probes.d Update copyrights for 2013 2013-01-01 17:15:01 -05:00