postgresql/src
Tom Lane 0d3f4406df Allow aggregate functions to be VARIADIC.
There's no inherent reason why an aggregate function can't be variadic
(even VARIADIC ANY) if its transition function can handle the case.
Indeed, this patch to add the feature touches none of the planner or
executor, and little of the parser; the main missing stuff was DDL and
pg_dump support.

It is true that variadic aggregates can create the same sort of ambiguity
about parameters versus ORDER BY keys that was complained of when we
(briefly) had both one- and two-argument forms of string_agg().  However,
the policy formed in response to that discussion only said that we'd not
create any built-in aggregates with varying numbers of arguments, not that
we shouldn't allow users to do it.  So the logical extension of that is
we can allow users to make variadic aggregates as long as we're wary about
shipping any such in core.

In passing, this patch allows aggregate function arguments to be named, to
the extent of remembering the names in pg_proc and dumping them in pg_dump.
You can't yet call an aggregate using named-parameter notation.  That seems
like a likely future extension, but it'll take some work, and it's not what
this patch is really about.  Likewise, there's still some work needed to
make window functions handle VARIADIC fully, but I left that for another
day.

initdb forced because of new aggvariadic field in Aggref parse nodes.
2013-09-03 17:08:46 -04:00
..
backend Allow aggregate functions to be VARIADIC. 2013-09-03 17:08:46 -04:00
bin Allow aggregate functions to be VARIADIC. 2013-09-03 17:08:46 -04:00
common
include Allow aggregate functions to be VARIADIC. 2013-09-03 17:08:46 -04:00
interfaces Translation updates 2013-09-02 02:43:18 -04:00
makefiles
pl Translation updates 2013-09-02 02:43:18 -04:00
port
template
test Allow aggregate functions to be VARIADIC. 2013-09-03 17:08:46 -04:00
timezone Update time zone data files to tzdata release 2013d. 2013-09-02 15:06:21 -04:00
tools Update Emacs configuration 2013-08-13 20:08:44 -04:00
tutorial
.gitignore
bcc32.mak
DEVELOPERS
Makefile
Makefile.global.in
Makefile.shlib
nls-global.mk
win32.mak