Re: Variadic parameters vs parameter defaults - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Variadic parameters vs parameter defaults
Date
Msg-id 494A1C85.6050108@gmx.net
Whole thread Raw
In response to Re: Variadic parameters vs parameter defaults  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Preventing index scans for non-recoverable index AMs
Next
From: Peter Eisentraut
Date:
Subject: Re: Function with defval returns error