Robert Haas <robertmh...@gmail.com> writes: > distinct_col_search() is going to return the relevant equality > operator from the argument list, which is ultimately going to come > from the RestrictInfo for the join clause. So I need to see whether > that's compatible with the index, but equality_ops_are_compatible() > wants two equality operators, and what I have is one equality operator > and one operator class.
For that you just check if the operator is a member of the class. (You might need to verify that it's an equality operator in the class too; not clear if the context is enough to be sure that it's not '<' for example.) Note that you really want to think about opfamilies not opclasses. So if you have an index opclass you really get its containing family and look for membership in that. > I am having a hard time wrapping my brain around what it means to have > multiple, incompatible notions of equality... any help appreciated! Well, for instance a complex-number datatype could have one btree opclass that sorts on absolute value (distance from 0,0) and another opclass that sorts on real part. In the first case "equal" values would be members of the same circle around the origin, in the second case they are members of the same vertical line. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers