Re: declarations of range-vs-element <@ and @> - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: declarations of range-vs-element <@ and @>
Date
Msg-id 1321553927.11794.17.camel@jdavis
Whole thread Raw
In response to Re: declarations of range-vs-element <@ and @>  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: declarations of range-vs-element <@ and @>
List pgsql-hackers
On Wed, 2011-11-16 at 16:41 -0500, Tom Lane wrote:
> But what surprises me about this example is that I'd have expected the
> heuristic "assume the unknown is of the same type as the other input"
> to resolve it.  Looking more closely, I see that we apply that heuristic
> in such a way that it works only for exact operator matches, not for
> matches requiring coercion (including polymorphic-type matches).  This
> seems a bit weird.  I propose adding a step to func_select_candidate
> that tries to resolve things that way, ie, if all the known-type inputs
> have the same type, then try assuming that the unknown-type ones are of
> that type, and see if that leads to a unique match.  There actually is a
> comment in there that claims we do that, but the code it's attached to
> is really doing something else that involves preferred types within
> type categories...
> 
> Thoughts?

That sounds reasonable to me.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Are range_before and range_after commutator operators?
Next
From: Robert Haas
Date:
Subject: Re: Refactoring on DROP/ALTER SET SCHEMA/ALTER RENAME TO statement