Обсуждение: Function with Variable number of parameters

Поиск
Список
Период
Сортировка

Function with Variable number of parameters

От
Edwin Ramirez
Дата:
Hello,

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

-esr-




Re: Function with Variable number of parameters

От
Alvaro Herrera
Дата:
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

От
"Pavel Stehule"
Дата:
>
>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/