Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Patches > Re: variadic fu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 3891 of 4249
Post > Topic >>

Re: variadic function sup****t

by pgsql@[EMAIL PROTECTED] (Jeff Davis) Jul 12, 2008 at 11:06 PM

On Tue, 2008-06-24 at 17:10 +0200, Pavel Stehule wrote:
> Hello
> 
> this version implements syntax based on argmodes.
> 
> 
> CREATE FUNCTION mleast(variadic numeric[]) RETURNS numeric AS $$
>     SELECT min($1[i])
>        FROM generate_subscripts($1,1) g(i);
> $$ LANGUAGE SQL;
> 

I don't have a strong opinion about whether the variadic argument is
declared as an array or scalar, so I am posting my comments about this
version of the patch as well.

This version also has a problem when declaring two functions "foo(int)"
and "foo(variadic int[])". In this version, the declaration is allowed
but the backend crashes when the function is called.

The variable "transform_variadic" should have some kind of comment. It
seems to be there to distinguish between when you're looking for a
candidate function for a function call, and when you're looking for a
candidate function for, e.g., CREATE FUNCTION. It's a little hard to
follow, and is probably the cause for the aformentioned crash.

Also, it doesn't seem to allow calls to a variadic function with zero
arguments, e.g. "mleast()". I think this should be allowed.

I suggest the following error message rewording:
"variadic argument isn't an array" should be something like: "variadic
argument must be an array".

Regards,
	Jeff Davis


-- 
Sent via pgsql-patches mailing list (pgsql-patches@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches
 




 1 Posts in Topic:
Re: variadic function support
pgsql@[EMAIL PROTECTED]   2008-07-12 23:06:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 11:37:46 CST 2008.