Re: [HACKERS] Domains and function arguments

2003-06-17 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: Tom Lane writes: 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 surprising. Even if you try to work it out, it's going to be a mess. During resolution, you

Re: [HACKERS] Domains and function arguments

2003-06-17 Thread Josh Berkus
Tom, If you insist on allowing domains in argument lists, then I think the best approach is this: For purpose of function resolution, types and all domains defined over them are equivalent. That would mean, for example, that if you define positive_int as domain over int, then you cannot define

[HACKERS] Domains and function arguments

2003-06-16 Thread Peter Eisentraut
It seems that there are still a few problems with the resolution of functions that have domains as arguments. Take these two domains: create domain testdomain1 as int; create domain testdomain2 as int; Take these two functions: create function foofunc(testdomain1) returns int as 'select 1'

Re: [HACKERS] Domains and function arguments

2003-06-16 Thread Tom Lane
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