Re: variadic flag doesn't work with "any" type - Mailing list pgsql-bugs

From Tom Lane
Subject Re: variadic flag doesn't work with "any" type
Date
Msg-id 8691.1291934337@sss.pgh.pa.us
Whole thread Raw
In response to Re: variadic flag doesn't work with "any" type  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: variadic flag doesn't work with "any" type  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-bugs
Pavel Stehule <pavel.stehule@gmail.com> writes:
> I didn't explain it well, sorry

> so I have a function foo(variadic "any")

> usual calling like foo(10,20) or foo('a',10) working perfectly. But I
> have a problem with call with VARIADIC keyword

> like foo(VARIADIC ARRAY[10,20]) or foo(VARIADIC ARRAY['a','10']).

> Keyword VARIADIC is allowed, and this a calling doesn't raise any
> error.

What exactly is the use-case for that?  You can't expect that an array
will hold the parameter list, since the parameters might not be all the
same type.

>              -------- CALL foo(VARIADIC ARRAY[10,20,20]) ---> real
> call foo(10,20,20) -- but it doesn't work now.

I'm not convinced it should work that way.  Even if you had convinced me
that this was sensible and had a real use-case, making it work like that
would take a whole bunch of mechanism that doesn't exist.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: variadic flag doesn't work with "any" type
Next
From: Pavel Stehule
Date:
Subject: Re: variadic flag doesn't work with "any" type