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

Re: variadic flag doesn't work with "any" type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: variadic flag doesn't work with "any" type
Date: 2010-12-09 22:38:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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

In response to


pgsql-bugs by date

Next:From: nobuyuki yoshidaDate: 2010-12-10 02:41:38
Subject: BUG #5788: I can drop table , with other user's table
Previous:From: Pavel StehuleDate: 2010-12-09 22:26:30
Subject: Re: variadic flag doesn't work with "any" type

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