Function with Variable number of parameters

Started by Edwin Ramirezabout 20 years ago3 messages
#1Edwin Ramirez
edwin.ramirez@mssm.edu

Hello,

Are variable number of parameters supported in the new version of Postgres?

-esr-

#2Alvaro Herrera
alvherre@commandprompt.com
In reply to: Edwin Ramirez (#1)
Re: Function with Variable number of parameters

Edwin Ramirez wrote:

Hello,

Are variable number of parameters supported in the new version of Postgres?

No, but overloading continues to be supported (which means you can
create one function for each number of parameters). Functions with
rowtype arguments are supported as well. True variadic functions are
not supported, however.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#3Pavel Stehule
pavel.stehule@hotmail.com
In reply to: Edwin Ramirez (#1)
Re: Function with Variable number of parameters

Are variable number of parameters supported in the new version of Postgres?

Hello

no, there isn't way for it without modification of parser. Or you can write
somethink like

create function a(init, int, int, int) ..
create function a(int, int, int) returns .. return a($1,$2,$3, null)

Regards
Pavel Stehule

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/