Re: Variadic parameters vs parameter defaults

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Variadic parameters vs parameter defaults
Дата
Msg-id 494A1C85.6050108@gmx.net
обсуждение исходный текст
Ответ на Re: Variadic parameters vs parameter defaults  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> Yeah, I don't like putting extra restrictions on the polymorphic case
> either.  Also, see my nearby note about how letting fewer defaults win
> over more defaults might be unsafe.  Consider
> 
>     foo (f1 int)
>     foo (f1 int, f2 variadic int[])
> 
> If the system allows f2 to be defaulted to zero elements, then these two
> functions would have to be considered ambiguous under the stricter rule.
> This would make it *impossible* for the user to override the default
> zero-argument behavior, even with the trick of using an additional
> function.

Hmm, that use case might best be addressed by allowing the variadic 
argument to be omitted (or defaulted) if all previous arguments are 
omittable.


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Preventing index scans for non-recoverable index AMs
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Function with defval returns error