On 27.02.25 23:17, Mark Dilger wrote:

On Thu, Feb 27, 2025 at 8:27 AM Tom Lane <t...@sss.pgh.pa.us <mailto:t...@sss.pgh.pa.us>> wrote:

    Peter Eisentraut <pe...@eisentraut.org
    <mailto:pe...@eisentraut.org>> writes:
     > Generalize hash and ordering support in amapi
     > Stop comparing access method OID values against HASH_AM_OID and
     > BTREE_AM_OID, and instead check the IndexAmRoutine for an index
    to see
     > if it advertises its ability to perform the necessary ordering,
     > hashing, or cross-type comparing functionality.  A field amcanorder
     > already existed, this uses it more widely.  Fields amcanhash and
     > amcancrosscompare are added for the other purposes.

    AFAICS, this patch sets amcancrosscompare true only for btree,
    which means this change to equality_ops_are_compatible is surely wrong:

    -       /* must be btree or hash */
    -       if (op_form->amopmethod == BTREE_AM_OID ||
    -           op_form->amopmethod == HASH_AM_OID)
    +       if (amroutine->amcancrosscompare)


It seems you are right.  hashhandler()'s amroutine should have this true, also.

I have fixed that.  I will come back to the rest of the discussion in a bit.



Reply via email to