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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

Reply via email to