Peter Eisentraut <[EMAIL PROTECTED]> writes:
> The SQL standard does not allow functions to have domains as arguments.
> Semantically, they have a point.

I don't think they do.  Declaring a domain as the input type seems a
very natural way of asserting that the function only works over a subset
of the base input type.  For example, log() might usefully be declared
to take arguments from a "positivereal" domain.

Admittedly, we have trouble resolving the type to use when a function is
overloaded with both a domain and a base type, but that's hardly

The present algorithm for ambiguous-function resolution is probably
excessively unfriendly to functions with domain inputs: it will match
them *only* when they are an exact match (ie, the input argument is
already declared or coerced to the domain type).  I think that's bowing
quite far enough in the direction of the standard; I'd like to loosen
it someday, but don't have time to think about it more right now.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?


Reply via email to