if (!HeapTupleIsValid(cla_ht))
elog(ERROR, "cache lookup failed for opclass %u", opclass);
cla_tup = (Form_pg_opclass) GETSTRUCT(cla_ht);
- Assert(cla_tup->opcmethod == BTREE_AM_OID);
opfamily = cla_tup->opcfamily;
opcintype = cla_tup->opcintype;
ReleaseSysCache(cla_ht);
- op = get_opfamily_member(opfamily, opcintype, opcintype,
- BTEqualStrategyNumber);
+ op = get_opfamily_member_for_cmptype(opfamily, opcintype, opcintype, COMPARE_EQ);
if (!OidIsValid(op))
- elog(ERROR, "missing operator %d(%u,%u) in opfamily %u",
- BTEqualStrategyNumber, opcintype, opcintype, opfamily);
+ elog(ERROR, "missing equality operator for (%u,%u) in opfamily %u",
+ opcintype, opcintype, opfamily);
/*
* If we find the same column with the same equality semantics
/*
* Must be unique, valid, immediate, non-partial, and be defined over
- * plain user columns (not expressions). We also require it to be a
- * btree. Even if we had any other unique index kinds, we'd not know how
- * to identify the corresponding equality operator, nor could we be sure
- * that the planner could implement the required FULL JOIN with non-btree
- * operators.
+ * plain user columns (not expressions).
*/
if (indexStruct->indisunique &&
indexStruct->indimmediate &&
- indexRel->rd_rel->relam == BTREE_AM_OID &&
indexStruct->indisvalid &&
RelationGetIndexPredicate(indexRel) == NIL &&
indexStruct->indnatts > 0)