mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +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:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_aggregate.c,v 1.93 2008/06/19 00:46:04 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_aggregate.c,v 1.94 2008/07/16 01:30:22 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -293,6 +293,7 @@ lookup_agg_function(List *fnName,
|
||||
{
|
||||
Oid fnOid;
|
||||
bool retset;
|
||||
int nvargs;
|
||||
Oid *true_oid_array;
|
||||
FuncDetailCode fdresult;
|
||||
AclResult aclresult;
|
||||
@@ -305,8 +306,8 @@ lookup_agg_function(List *fnName,
|
||||
* function's return value. it also returns the true argument types to
|
||||
* the function.
|
||||
*/
|
||||
fdresult = func_get_detail(fnName, NIL, nargs, input_types,
|
||||
&fnOid, rettype, &retset,
|
||||
fdresult = func_get_detail(fnName, NIL, nargs, input_types, false,
|
||||
&fnOid, rettype, &retset, &nvargs,
|
||||
&true_oid_array);
|
||||
|
||||
/* only valid case is a normal function not returning a set */
|
||||
|
||||
Reference in New Issue
Block a user