Re: Domains and type coercion - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: Domains and type coercion
Date
Msg-id 3C99E576.F9E12B01@fourpalms.org
Whole thread Raw
In response to Domains and type coercion  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Domains and type coercion  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
...
> The problem seems to be that when parse_func looks for "exact match"
> operators, it doesn't consider numeric to be an exact match for mydom.
> So that heuristic fails and we're left with no unique best choice for
> the operator.

Sure. At the moment there is no reason for parse_func to think that
mydom is anything, right?

> I'm not sure if there's anything much that can be done about this.

Something has to be done ;)

> We could treat exact and binary-compatible matches alike (doesn't seem
> good), or put a special case into the operator selection rules to reduce
> domains to their basetypes before making the "exact match" test.
> Neither of these seem real appealing, but if we don't do something
> I think that domains are going to be a big pain in the neck to use.

There could also be an explicit heuristic *after* the exact match
gathering to look for an exact match for domains reduced to their base
types. Is there any reason to look for domains before that?
                    - Thomas


pgsql-hackers by date:

Previous
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: Function call crashes server
Next
From: Peter Eisentraut
Date:
Subject: Re: Linux/mips compile should not use -mips2