Function Overloading

More than one function may be defined with the same name, as long as the arguments they take are different. In other words, function names can be overloaded. A function may also have the same name as an attribute. In the case that there is an ambiguity between a function on a complex type and an attribute of the complex type, the attribute will always be used.

The alternative form of the AS clause for the SQL CREATE FUNCTION command decouples the SQL function name from the function name in the C source code. This is the preferred technique to accomplish function overloading while avoiding having conflicting C-function names.

Warning

While the dynamic loading routines in most operating systems are more than happy to allow you to load any number of shared libraries that contain conflicting (identically-named) function names, they may in fact botch the load in interesting ways. If you want your function to be used on different architectures, do not overload C function names.