I wrote:
> Heikki Linnakangas <hlinnaka@iki.fi> writes:
>> I think that trying to find the equivalence member in
>> create_index_scan() is too fragile.
> I agree; will contemplate how to do this better.
I think probably what we ought to do here is just use exprType() of the
ORDER BY expression. There are opclasses for which that would not work,
because the operators are declared to accept anyarray or some other
pseudotype; but I'm not aware of any current or contemplated indexorderby
support that would hit such cases. It doesn't seem worth going out of
our way for full generality when there are a lot of other restrictions
on the indexorderby mechanism anyway.
regards, tom lane