Re: Function sugnature with default parameter - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: Function sugnature with default parameter
Date
Msg-id 530E37C0.5030805@agliodbs.com
Whole thread Raw
In response to Function sugnature with default parameter  (salah jubeh <s_jubeh@yahoo.com>)
Responses Re: Function sugnature with default parameter  (Andrew Dunstan <andrew@dunslane.net>)
Re: Function sugnature with default parameter  (salah jubeh <s_jubeh@yahoo.com>)
List 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
somethinglike 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



pgsql-hackers by date:

Previous
From: Leon Smith
Date:
Subject: Simplified VALUES parameters
Next
From: Josh Berkus
Date:
Subject: Re: Simplified VALUES parameters