comparing index columns - Mailing list pgsql-hackers

From Pavan Deolasee
Subject comparing index columns
Date
Msg-id 2e78013d0706120438n17961c72iaa0c916698390009@mail.gmail.com
Whole thread Raw
Responses Re: comparing index columns
List pgsql-hackers
<br clear="all" />Hi,<br /><br />As per HOT design, a necessary condition to do HOT updates is<br />that an index
columnmust not be updated. I am invoking the type<br />specific equality operator to compare two index columns,
something<br />like this (which I think I had copied from ri_KeysEqual(), but that too have<br />changed now):<br /><br
/>           typeid = SPI_gettypeid(relation->rd_att, attrnum);<br />            typentry =
lookup_type_cache(typeid,TYPECACHE_EQ_OPR_FINFO); <br /><br />            if
(!OidIsValid(typentry->eq_opr_finfo.fn_oid))<br/>                ereport(ERROR,<br />                       
(errcode(ERRCODE_UNDEFINED_FUNCTION),<br/>                                errmsg("could not identify an equality
operator" <br />                                "for type %s", format_type_be(typeid))));<br /><br />            /*<br
/>            * Call the type specific '=' function<br />             */<br />            if
(!DatumGetBool(FunctionCall2(&(typentry->eq_opr_finfo),<br />                                             
oldvalue,newvalue)))<br />                return true;<br />        <br />Heikki pointed out that this may not work
correctlywith operator classes<br />where we should actually be using the operator from the given operator class <br
/>insteadof the default operator of the type.<br /><br />I don't have much insight into the operator classes and
operatorfamilies<br />and how they work. Where should I look for the related code ? Is there<br />anything else we
shouldbe worried about as well ? <br /><br />Any help is appreciated.<br /><br /><br />Thanks,<br />Pavan<br /><br />--
<br/>Pavan Deolasee<br />EnterpriseDB     <a href="http://www.enterprisedb.com">http://www.enterprisedb.com</a> 

pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: Autovacuum launcher doesn't notice death of postmaster immediately
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Selecting a constant question