Thread: Function with Variable number of parameters

Function with Variable number of parameters

From
Edwin Ramirez
Date:
Hello,

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

-esr-




Re: Function with Variable number of parameters

From
Alvaro Herrera
Date:
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.


Re: Function with Variable number of parameters

From
"Pavel Stehule"
Date:
>
>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/