Re: Variadic parameters vs parameter defaults

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(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 17:55:36
Message-ID: 162867790812170955w6b42cfccvd651adda86063daf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/12/17 Peter Eisentraut <peter_e(at)gmx(dot)net>:
> On Wednesday 17 December 2008 02:07:35 Tom Lane wrote:
>> Oh, and another thing --- should variadic parameters be defaultable?
>> The current patch doesn't allow it but it looks more like an oversight
>> than anything that was thought through. The boundary case for variadic
>> parameters is a bit weird already:
>>
>> regression=# create function fv (f1 int, f2 variadic int[]) returns int
>> regression-# as 'select $1' language sql;
>> CREATE FUNCTION
>
>> regression=# select fv(1);
>> ERROR: function fv(integer) does not exist
>> LINE 1: select fv(1);
>> ^
>> HINT: No function matches the given name and argument types. You might
>> need to add explicit type casts.
>
> That looks like a bug to me. Anything that you can do with 1 to N items
> should also work for zero.
>

no, when we discused about variadic functions we defined, so variadic
parameter should not be empty Please, look to archive.

Pavel

> Also, in C, variadic functions are quite commonly called with zero arguments
> in the variadic position.
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-12-17 18:11:55 Re: Variadic parameters vs parameter defaults
Previous Message Peter Eisentraut 2008-12-17 17:47:14 Re: Variadic parameters vs parameter defaults