Re: Calling variadic function with default value in named notation - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Calling variadic function with default value in named notation
Date
Msg-id CAKFQuwbmUfAQyXAD1PG2XGvWfRkziMi-9PpTHU5Lk=qrPAUSbg@mail.gmail.com
Whole thread Raw
In response to Re: Calling variadic function with default value in named notation  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Calling variadic function with default value in named notation
Next
From: Wolfgang Walther
Date:
Subject: Re: Calling variadic function with default value in named notation