Re: WIP: default values for function parameters

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: "postgres hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: default values for function parameters
Date: 2008-10-27 16:48:11
Message-ID: 162867790810270948q7ce45f35w7d74b78169208b86@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/10/27 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
> Pavel Stehule escribió:
>
>> postgres=# create function fx(a int, b int default 30, c int default 40)
>> postgres-# returns int as $$ select $1 + $2 + $3; $$
>> postgres-# language sql;
>
> How do you deal with the case where you have
> f(a int, b int default 1) and
> f(a int, b text default '1') ?
>
> select f(1); -- which one do you call?

it should raise exception - but actually it's undefined (I have known
bug in WIP patch).

regards
Pavel

> --
> Alvaro Herrera http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Emmanuel Cecchet 2008-10-27 16:53:37 Re: [HACKERS] Hot Standby utility and administrator functions
Previous Message Peter Eisentraut 2008-10-27 16:47:50 Re: array_agg and array_accum (patch)