Re: Calling PL functions with named parameters

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Calling PL functions with named parameters
Дата
Msg-id 411D4C3A.8050108@opencloud.com
обсуждение исходный текст
Ответ на Re: Calling PL functions with named parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Calling PL functions with named parameters  (Gaetano Mendola <mendola@bigfoot.com>)
Список pgsql-hackers
Tom Lane wrote:

>>On a related note, it would also be nice to have default
>>parameters and some way to say to use them.
> 
> 
> That is fundamentally not ever going to happen, because it blows
> overloaded-function resolution out of the water: there is no way to
> choose whether "foo(42, 2.5)" matches foo(int, float) or
> foo(int, float, something-with-a-default).  Let's try to limit our
> attention to something that might actually work.

C++ manages to solve this problem, although I can't remember the exact 
mechanics (and C++ is usually not a good example to follow anyway ;)

How about just disallowing function signatures that cause ambiguity? 
i.e. make f(t1,t2,default t3,default t4,..) lay claim to f(t1,t2), 
f(t1,t2,t3), f(t1,t2,t3,t4) etc, and creation fails if any of those 
signatures are already claimed by another function.

-O


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gaetano Mendola
Дата:
Сообщение: Re: hot spare / log shipping work on
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Calling PL functions with named parameters