Re: Function sugnature with default parameter

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: salah jubeh <s_jubeh(at)yahoo(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Function sugnature with default parameter
Date: 2014-02-26 18:51:44
Message-ID: 530E37C0.5030805@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/26/2014 10:15 AM, salah jubeh wrote:
> I think, there is a difference between optional parameters and default parameter values. So, my suggestion would be something like this.

> SELECT default_test(1,3, DEFAULT); -- match function number 1
>
> SELECT default_test(1,3); -- match the function number 2
>
> SELECT default_test(1); -- ERROR
> Regards

This would break at least 4 major applications which I personally have
worked on, and the benefit to users is unclear at best.

One of the main reasons to *have* default parameters is to allow adding
new parameters to existing functions without breaking old application
code. So, -1 from me.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2014-02-26 18:54:45 Re: Simplified VALUES parameters
Previous Message Leon Smith 2014-02-26 18:47:04 Simplified VALUES parameters