I said:
> So I'm currently thinking we'd be better off not to try to eliminate
> the cross-type comparison operators. Instead we need some solution
> that is narrowly focused on the problem of making a non-indexable
> comparison indexable, by converting a comparison value of the wrong
> datatype into the right datatype locally to the indexscan plan
> generation code.
BTW, plan C would be to attack the problem head-on by allowing index
opclasses to include cross-datatype operators. This might be the
cleanest solution in the long run, but it seems likely to be a lot of
work and could force us to break existing user-defined operator classes.
I think everyone has shied away from that without much thought, but
in principle at least we could probably do it. (Say, extend pg_amop
and pg_amproc so that the datatype of the other operand becomes part
of the key.)
We are now well outside the charter of pgsql-general, so please redirect
any followup discussion to pgsql-hackers ...
regards, tom lane