Skip site navigation (1) Skip section navigation (2)

Re: variadic function support

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: variadic function support
Date: 2008-06-24 05:30:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
2008/6/23 Andrew Dunstan <andrew(at)dunslane(dot)net>:

> And what about a function that takes 2 arrays as arguments?

only last argument is evaluated as variadic

so function

create or replace function foo(a int[], b int[]) ... variadic

is called
select foo(array[1,2,3], 1,2,3,4,5,6)

> This proposal strikes me as half-baked. Either we need proper and full
> support for variadic functions, or we don't, but I don't think we need
> syntactic sugar like the above (or maybe in this case it's really syntactic
> saccharine).

there is some functions like Oracle's least,greater, decode that needs
this feature. So I can write wrappers. For me most important are new
possibility for C procedures. All this work is related to my JSON
support proposal.


> cheers
> andrew

In response to

pgsql-patches by date

Next:From: Pavel StehuleDate: 2008-06-24 05:39:22
Subject: Re: variadic function support
Previous:From: Andrew DunstanDate: 2008-06-24 03:42:48
Subject: Re: variadic function support

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group