Re: Calling PL functions with named parameters
От
Oliver Jowett
Тема
Re: Calling PL functions with named parameters
Дата
Msg-id
411DFBE1.7060007@opencloud.com
Ответ на
Re: Calling PL functions with named parameters (Gaetano Mendola)
Список
Дерево обсуждения
Re: Calling PL functions with named parameters Harald Fuchs <hf0722x@protecting.net>
Re: Calling PL functions with named parameters Gaetano Mendola <mendola@bigfoot.com>
Gaetano Mendola wrote: >> 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 ;) > > Your're wrong: > > try to compile this: [...] > a.cpp:6: error: call of overloaded `foo(int, double)' is ambiguous > a.cpp:1: error: candidates are: void foo(int, float) > a.cpp:2: error: void foo(int, float, int) > > usualy C++ is not a good example as SQL is not :-) I think you just made my point for me. C++ allows default parameters and resolves the ambiguity by disallowing ambiguous calls when they happen. I'm not sure why C++ doesn't disallow it at declaration time off the top of my head -- perhaps because you'd get inconsistent behaviour if the candidates were split across compilation units. Since we don't have that problem in the SQL function case, we can disallow ambiguity at the time of creating the function. -O
В списке pgsql-hackers по дате отправления