Re: Issues for named/mixed function notation patch

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Issues for named/mixed function notation patch
Date: 2009-10-07 22:25:38
Message-ID: 162867790910071525w2fcaafddiddddba360f080065@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/10/8 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Jeff Davis <pgsql(at)j-davis(dot)com> writes:
>> On Wed, 2009-10-07 at 17:45 -0400, Tom Lane wrote:
>>> I think what he was considering was the question of insisting that
>>> the VARIADIC keyword be attached to the named argument that actually
>>> matches the VARIADIC parameter.
>
>> It seems strange to me if we have a situation where changing the call:
>>   foo(a, b, VARIADIC c)
>> to be more explicit by using named call notation:
>>   foo(a AS x, b AS y, VARIADIC c AS z)
>> is "less correct" in the sense that the VARIADIC keyword goes from
>> "required" to "ignored".
>
> No, that's not what I'm driving at.  The small change that I've got in
> mind would require you to say VARIADIC, but it would allow the function
> to match both the above call and
>    foo(a AS x, c AS z, VARIADIC b AS y)
> when really z is the variadic parameter in this case.  I'm not sure if
> this would bother anyone or not.  It seems impossible that a function
> could ever have more than one variadic parameter, so there's not really
> any ambiguity from maintaining the syntactic rule that the VARIADIC
> keyword is at the end even when the variadic argument isn't, but it
> might look a bit odd.
>
> What I *don't* want to do is fix this by allowing/requiring
>    foo(a AS x, VARIADIC c AS z, b AS y)
> because it would be a bigger change in the grammar output structure than
> seems warranted.  We could possibly have VARIADIC throw an error if the
> named argument that matches to the variadic parameter isn't the last
> one, but I'm not sure that that's important rather than just pedantry.
> People would probably tend to write it that way anyway.

It is just pedantry. Position in named notation isn't important, and
there are no reason, why we VARIADIC should be last.

Pavel

>
>                        regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-10-07 22:31:16 Re: Issues for named/mixed function notation patch
Previous Message Alvaro Herrera 2009-10-07 22:21:37 Re: [COMMITTERS] pgsql: Make it possibly to specify GUC params per user and per database.