Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E20C81337BCF for ; Thu, 9 Dec 2010 18:39:06 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 03137-01 for ; Thu, 9 Dec 2010 22:39:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id CE68A1337BCE for ; Thu, 9 Dec 2010 18:38:59 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oB9Mcv5G008692; Thu, 9 Dec 2010 17:38:57 -0500 (EST) To: Pavel Stehule cc: pgsql-bugs@postgresql.org Subject: Re: variadic flag doesn't work with "any" type In-reply-to: References: <29821.1291928919@sss.pgh.pa.us> Comments: In-reply-to Pavel Stehule message dated "Thu, 09 Dec 2010 23:26:30 +0100" Date: Thu, 09 Dec 2010 17:38:57 -0500 Message-ID: <8691.1291934337@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/67 X-Sequence-Number: 28873 Pavel Stehule 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