I wrote:
>>> Right offhand I cannot see a reason why there should be different
>>> equality operators with the same sortops.  (If anyone can come up with
>>> a plausible scenario for that, stop me here...)

BTW, I think it's possible to prove that there need never be two for the
case of both sides the same datatype.  If we have a sortop "A < B" on a
single datatype, then its commutator is well defined: "A > B" if and
only if "B < A".  And by the trichotomy law, "A = B" must be true in
exactly those cases for which neither "A < B" nor "A > B".  So there is
only one possible behavior for an equality operator that is consistent
with the sortop.  (This is, in fact, the reason that we can get away
with considering a single sortop as fully specifying a sort order.)

This argument doesn't immediately go through if A and B are of different
datatypes, but it's pretty hard to think of a case where it wouldn't

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at


Reply via email to