Re: Function sugnature with default parameter

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Function sugnature with default parameter
Дата
Msg-id 530E37C0.5030805@agliodbs.com
обсуждение исходный текст
Ответ на Function sugnature with default parameter  (salah jubeh <s_jubeh@yahoo.com>)
Ответы Re: Function sugnature with default parameter  (Andrew Dunstan <andrew@dunslane.net>)
Re: Function sugnature with default parameter  (salah jubeh <s_jubeh@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Leon Smith
Дата:
Сообщение: Simplified VALUES parameters
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Simplified VALUES parameters