Re: Variadic parameters vs parameter defaults

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Variadic parameters vs parameter defaults
Date: 2008-12-17 18:17:43
Message-ID: 1229537863.26139.24.camel@dell.linuxdev.us.dell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2008-12-17 at 19:43 +0200, Peter Eisentraut wrote:
> That looks like a bug to me. Anything that you can do with 1 to N items
> should also work for zero.
>

Previous discussion link:

http://archives.postgresql.org/pgsql-patches/2008-07/msg00149.php

You can make either mechanism do what you want by defining the right set
of functions. If a minimum of one argument per variadic parameter is
required, you can work around it by defining an extra function with no
variadic parameter to handle the zero-argument case.

So, although I agree with you, I don't have a strong opinion, and I'm
happy with either.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ibrar Ahmed 2008-12-17 18:24:28 Review: B-Tree emulation for GIN
Previous Message Tom Lane 2008-12-17 18:11:55 Re: Variadic parameters vs parameter defaults