diff options
| author | Tom Lane | 2008-07-16 01:30:23 +0000 |
|---|---|---|
| committer | Tom Lane | 2008-07-16 01:30:23 +0000 |
| commit | d89737d31c03d90a2b0412e63953493576a2a3d7 (patch) | |
| tree | 0afc63e59fae7ec3c53339641a6f65e6a04733d2 /src/include/parser | |
| parent | 2c773296f88fe800315ca1bf131287662ecef999 (diff) | |
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/include/parser')
| -rw-r--r-- | src/include/parser/parse_func.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/include/parser/parse_func.h b/src/include/parser/parse_func.h index 3635f2eede4..ec619a4ac54 100644 --- a/src/include/parser/parse_func.h +++ b/src/include/parser/parse_func.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/parser/parse_func.h,v 1.59 2008/01/01 19:45:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/parser/parse_func.h,v 1.60 2008/07/16 01:30:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -43,13 +43,13 @@ typedef enum extern Node *ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, - bool agg_star, bool agg_distinct, bool is_column, - int location); + bool agg_star, bool agg_distinct, bool func_variadic, + bool is_column, int location); extern FuncDetailCode func_get_detail(List *funcname, List *fargs, - int nargs, Oid *argtypes, + int nargs, Oid *argtypes, bool expand_variadic, Oid *funcid, Oid *rettype, - bool *retset, Oid **true_typeids); + bool *retset, int *nvargs, Oid **true_typeids); extern int func_match_argtypes(int nargs, Oid *input_typeids, |
