Re: fix - function call with variadic parameter for type "any"

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fix - function call with variadic parameter for type "any"
Date: 2009-04-02 21:02:58
Message-ID: 162867790904021402i634b731bje331bc3764bcd700@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/4/2 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> actually, there isn't any difference between a) and b)
>
>> a) select somevariadicwithany(10);
>> b) select somevariadicwithany(variadic 10);
>
>> in this case the keyword VARIADIC is ignored.
>
> Well, in my mind what the VARIADIC keyword does is it prevents the parser
> from building an ARRAY[] expression around the remaining parameters.
> Which would be incorrect for a VARIADIC ANY function because such a
> function presumably doesn't want to force all the actual arguments
> to be the same type --- if it did, it could use VARIADIC ANYARRAY.
>
> VARIADIC ANY basically exists to allow an ANY-argument function to
> accept any number of ANY parameters.  As such, PG_NARGS() is all it
> really needs to know, plus the already-existing support for obtaining
> the parameters' actual datatypes.
>
>

it can be good idea - I see only one disadvantage.

I will have two functions with same body - but it isn't significant problem

regards
Pavel Stehule

                       regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-04-02 21:21:25 Re: Additional DTrace Probes
Previous Message Bruce Momjian 2009-04-02 21:00:51 Re: Additional DTrace Probes