Re: Variadic parameters vs parameter defaults

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Brendan Jurd" <direvus(at)gmail(dot)com>
Subject: Re: Variadic parameters vs parameter defaults
Date: 2008-12-17 20:49:03
Message-ID: 87abaumssg.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> On Wednesday 17 December 2008 20:50:22 Tom Lane wrote:
>>> The behavior at zero arguments is
>>> certainly a judgment call, but it seems to me that we'll wind up with
>>> more warts and less flexibility if we try to make the system install a
>>> default behavior for that case.
>
>> Maybe we'll just let it be for now and see what kind of user demands we get.
>
> Fair enough. We could possibly have the system install a "default
> default" for variadic arguments, but I'd rather add that later
> on the basis of demand than stick it in now.

My inclination would be to say zero arguments is zero arguments and you get a
zero-length array. We could eliminate the problem with anyelement by saying
the variadic argument can't be the only polymorphic argument.

I think there are going to be more users using non-polymorphic arguments who
are surprised that no arguments is a special case than people using
polymorphic arguments who are annoyed by restrictions at the intersection.

Actually I think my vote would be for whatever requires the least code now. If
you've already committed something then let's just go with that.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's Slony Replication support!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-12-17 20:55:26 Re: Latest version of Hot Standby patch
Previous Message Robert Lor 2008-12-17 19:49:12 Re: DTrace probes patch