Re: Issues for named/mixed function notation patch

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(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 21:41:06
Message-ID: 1254951666.16369.34.camel@monkey-cat.sm.truviso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2009-10-07 at 16:58 -0400, Tom Lane wrote:
> * completely ignores variadic functions when trying to match
> a call having any named arguments
>
> * does not throw an error for use of the VARIADIC keyword
> in a call together with named arguments
>
> Neither of these behaviors quite seem to me to satisfy the principle of
> least astonishment, and in combination they definitely do not.

I agree that the combination is wrong, and we should either allow that
call notation or throw a useful error message when it's attempted.

> It seems to me that there is not anything wrong with using named
> arguments together with VARIADIC and getting a match to a variadic
> function.

The general feeling was that we should only support the most obvious
call notations so we wouldn't have backwards compatibility problems if
we tried to change it later.

If we allow calling a variadic function using named notation, the
VARIADIC keyword is not strictly necessary, but I think we should
require it. It seems strange without it.

Pavel indicated that there may be some implementation difficulty in
requiring the VARIADIC keyword when calling a variadic function using
named notation:

http://archives.postgresql.org/pgsql-hackers/2009-09/msg01792.php

and that just kind of pushed the idea from "maybe that's OK" to
"probably not a good idea right now".

Robert Haas weighed in here:

http://archives.postgresql.org/pgsql-hackers/2009-09/msg01732.php

Its fine with me to allow it, assuming there's a reasonable way to
implement it, and assuming that the VARIADIC keyword is required.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-10-07 21:45:55 Re: Issues for named/mixed function notation patch
Previous Message Pavel Stehule 2009-10-07 21:32:48 Re: Issues for named/mixed function notation patch