Re: Calling variadic function with default value in named notation

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Calling variadic function with default value in named notation
Дата
Msg-id CAKFQuwbmUfAQyXAD1PG2XGvWfRkziMi-9PpTHU5Lk=qrPAUSbg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Calling variadic function with default value in named notation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Wed, Oct 28, 2020 at 2:18 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
One could imagine saying that if the function has a variadic last
parameter, then we can match that to zero or more positional arguments
after the last named argument.  Not sure that that would be a good
idea though, or how hard it'd be to implement.  It'd be a pretty
radical departure from the rules for non-variadic functions.
 
I too failed to realize that there was an implied, required, positional, parameter, of cardinality zero, following the named parameter.  I see no reason to make that case work.  I'm doubtful additional words in the documentation, examples or otherwise, would have helped people commit this edge case to memory.  The error message would be of benefit but IMO it isn't worth the effort given the sparsity of complaints and the assumed rarity that all three of these dynamics come into play in order to have an obscure doesn't work scenario.

David J.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Calling variadic function with default value in named notation
Следующее
От: Wolfgang Walther
Дата:
Сообщение: Re: Calling variadic function with default value in named notation