Re: Issues for named/mixed function notation patch

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Issues for named/mixed function notation patch
Дата
Msg-id 1254951666.16369.34.camel@monkey-cat.sm.truviso.com
обсуждение исходный текст
Ответ на Re: Issues for named/mixed function notation patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Issues for named/mixed function notation patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Issues for named/mixed function notation patch
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Issues for named/mixed function notation patch