diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-07-16 01:30:23 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-07-16 01:30:23 +0000 |
commit | d89737d31c03d90a2b0412e63953493576a2a3d7 (patch) | |
tree | 0afc63e59fae7ec3c53339641a6f65e6a04733d2 /src/backend/utils/adt/regproc.c | |
parent | 2c773296f88fe800315ca1bf131287662ecef999 (diff) | |
download | postgresql-d89737d31c03d90a2b0412e63953493576a2a3d7.tar.gz postgresql-d89737d31c03d90a2b0412e63953493576a2a3d7.zip |
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
Diffstat (limited to 'src/backend/utils/adt/regproc.c')
-rw-r--r-- | src/backend/utils/adt/regproc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/utils/adt/regproc.c b/src/backend/utils/adt/regproc.c index 986bac041d9..d50dc23d778 100644 --- a/src/backend/utils/adt/regproc.c +++ b/src/backend/utils/adt/regproc.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/regproc.c,v 1.107 2008/06/19 00:46:05 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/regproc.c,v 1.108 2008/07/16 01:30:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -131,7 +131,7 @@ regprocin(PG_FUNCTION_ARGS) * pg_proc entries in the current search path. */ names = stringToQualifiedNameList(pro_name_or_oid); - clist = FuncnameGetCandidates(names, -1); + clist = FuncnameGetCandidates(names, -1, false); if (clist == NULL) ereport(ERROR, @@ -189,7 +189,8 @@ regprocout(PG_FUNCTION_ARGS) * Would this proc be found (uniquely!) by regprocin? If not, * qualify it. */ - clist = FuncnameGetCandidates(list_make1(makeString(proname)), -1); + clist = FuncnameGetCandidates(list_make1(makeString(proname)), + -1, false); if (clist != NULL && clist->next == NULL && clist->oid == proid) nspname = NULL; @@ -276,7 +277,7 @@ regprocedurein(PG_FUNCTION_ARGS) */ parseNameAndArgTypes(pro_name_or_oid, false, &names, &nargs, argtypes); - clist = FuncnameGetCandidates(names, nargs); + clist = FuncnameGetCandidates(names, nargs, false); for (; clist; clist = clist->next) { |