Support "variadic" functions, which can accept a variable number of arguments
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 16 Jul 2008 01:30:23 +0000 (01:30 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 16 Jul 2008 01:30:23 +0000 (01:30 +0000)
commit9da84d1c6cf8c37a46b3f85c054404ebf7b695d0
tree5f83702ad8d86ebf3a5429d695a6f528ad9a65b2
parent105bece010aff2f8a6b3127fc1ffad112c440d25
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
38 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/extend.sgml
doc/src/sgml/plpgsql.sgml
doc/src/sgml/ref/alter_function.sgml
doc/src/sgml/ref/comment.sgml
doc/src/sgml/ref/create_function.sgml
doc/src/sgml/ref/drop_function.sgml
doc/src/sgml/typeconv.sgml
doc/src/sgml/xfunc.sgml
src/backend/catalog/information_schema.sql
src/backend/catalog/namespace.c
src/backend/catalog/pg_aggregate.c
src/backend/commands/functioncmds.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/parser/gram.y
src/backend/parser/keywords.c
src/backend/parser/parse_expr.c
src/backend/parser/parse_func.c
src/backend/parser/parse_utilcmd.c
src/backend/utils/adt/regproc.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/fmgr/funcapi.c
src/bin/pg_dump/pg_dump.c
src/bin/psql/describe.c
src/include/catalog/catversion.h
src/include/catalog/namespace.h
src/include/catalog/pg_proc.h
src/include/nodes/parsenodes.h
src/include/parser/parse_func.h
src/interfaces/ecpg/preproc/preproc.y
src/pl/plpgsql/src/pl_comp.c
src/pl/plpython/plpython.c
src/test/regress/expected/plpgsql.out
src/test/regress/expected/polymorphism.out
src/test/regress/sql/plpgsql.sql
src/test/regress/sql/polymorphism.sql