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

From Brendan Jurd
Subject Re: Variadic parameters vs parameter defaults
Date
Msg-id 37ed240d0812161718o2fa816d1ya6c79932734b2c28@mail.gmail.com
Whole thread Raw
In response to Variadic parameters vs parameter defaults  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Variadic parameters vs parameter defaults  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Dec 17, 2008 at 11:07 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> ISTM one could make a pretty good argument that this last case should
> succeed, producing an empty-array argument.  If you buy that, then it
> is sensible to forbid defaults for variadics,

Yep, +1 for this approach.  I would intuitively expect that, if I omit
variadic argument(s) when calling a function, that the function ends
up getting an empty array of the appropriate type.

And when writing a variadic function, I wouldn't find it all
surprising or annoying if I was not allowed to override this default.
In the unlikely case I want my function to do something special when
it gets an empty array, I can write that behaviour into the function
body.

Cheers,
BJ


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Another issue in default-values patch: defaults expanded too soon
Next
From: Tom Lane
Date:
Subject: Re: Variadic parameters vs parameter defaults