Hi, As per HOT design, a necessary condition to do HOT updates is that an index column must not be updated. I am invoking the type specific equality operator to compare two index columns, something like this (which I think I had copied from ri_KeysEqual(), but that too have changed now):
typeid = SPI_gettypeid(relation->rd_att, attrnum); typentry = lookup_type_cache(typeid, TYPECACHE_EQ_OPR_FINFO); if (!OidIsValid(typentry->eq_opr_finfo.fn_oid)) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_FUNCTION), errmsg("could not identify an equality operator " "for type %s", format_type_be(typeid)))); /* * Call the type specific '=' function */ if (!DatumGetBool(FunctionCall2(&(typentry->eq_opr_finfo), oldvalue, newvalue))) return true; Heikki pointed out that this may not work correctly with operator classes where we should actually be using the operator from the given operator class instead of the default operator of the type. I don't have much insight into the operator classes and operator families and how they work. Where should I look for the related code ? Is there anything else we should be worried about as well ? Any help is appreciated. Thanks, Pavan -- Pavan Deolasee EnterpriseDB http://www.enterprisedb.com