1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Support "variadic" functions, which can accept a variable number of arguments

so long as all the trailing arguments are of the same (non-array) type.
The function receives them as a single array argument (which is why they
have to all be the same type).

It might be useful to extend this facility to aggregates, but this patch
doesn't do that.

This patch imposes a noticeable slowdown on function lookup --- a follow-on
patch will fix that by adding a redundant column to pg_proc.

Pavel Stehule
This commit is contained in:
Tom Lane
2008-07-16 01:30:23 +00:00
parent 2c773296f8
commit d89737d31c
38 changed files with 915 additions and 170 deletions

View File

@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.493 2008/07/01 11:46:48 heikki Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.494 2008/07/16 01:30:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -6435,15 +6435,18 @@ format_function_arguments(FuncInfo *finfo, int nallargs,
{
switch (argmodes[j][0])
{
case 'i':
case PROARGMODE_IN:
argmode = "";
break;
case 'o':
case PROARGMODE_OUT:
argmode = "OUT ";
break;
case 'b':
case PROARGMODE_INOUT:
argmode = "INOUT ";
break;
case PROARGMODE_VARIADIC:
argmode = "VARIADIC ";
break;
default:
write_msg(NULL, "WARNING: bogus value in proargmodes array\n");
argmode = "";