From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: variadic flag doesn't work with "any" type
Date: Thu, 09 Dec 2010 17:38:57 -0500
Message-ID: <8691.1291934337@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTinU-jsNCiL9XUgnfatKZTixvSxWeG1N35XBfR2S@mail.gmail.com>
References: <AANLkTimZPnb006g7xUKS0mT3KBYngGzohsNMmGMBnFUq@mail.gmail.com>
<29821.1291928919@sss.pgh.pa.us>
<AANLkTinU-jsNCiL9XUgnfatKZTixvSxWeG1N35XBfR2S@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pavel.stehule@gmail.com
Subject: Re: variadic flag doesn't work with "any" type
In-Reply-To: <8691.1291934337@sss.pgh.pa.us>
References: <AANLkTimZPnb006g7xUKS0mT3KBYngGzohsNMmGMBnFUq@mail.gmail.com> <29821.1291928919@sss.pgh.pa.us> <AANLkTinU-jsNCiL9XUgnfatKZTixvSxWeG1N35XBfR2S@mail.gmail.com> <8691.1291934337@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox