GiST Comparing IndexTuples/Datums - Mailing list pgsql-hackers

From Matthew Campbell
Subject GiST Comparing IndexTuples/Datums
Date
Msg-id c2cc277f0702121211x3ae5409ax776b1c9e64d893ea@mail.gmail.com
Whole thread Raw
Responses Re: GiST Comparing IndexTuples/Datums  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hey folks:<br /><br />    I posted this to the pgsql-novice mailing list but was told that it'd probably be better to
reposthere.  I've been working with a group trying to implement UNIQUE index functionality in GiST (we started with
hash,and have branched out to try and understand some of the other indexing structures as well).  We installed the
btree-gistcontrib module and have gist indexes working fine and understanding when it's supposed to be unique
(regardlessof which contrib module is installed).  We currently can walk over all the IndexTuples in a page and we were
hopingto compare the IndexTuple passed into the gistdoinsert() function (the new itup being added to the index) to each
ofthe IndexTuples in said page.  The idea we've been playing with right now is using 'datum = index_getattr(itup, 1,
RelationGetDescr(r),&isnull);' as its used in hashinsert.c, but we can't figure out how to compare the two datums
then. The actual data type of the value being inserted would be different depending on the type of column you created
theindex on.  Since you provide an opclass when creating a gist index, are we supposed to use one of the user defined
functionsto compare items?  (One of them is 'same', so in btree-gist, the function is gbt_text_same() for indexes on
charand text columns)  Is there a general way to access these functions without knowing specifically what contrib
moduleis specified, something like OpClassFunction7()?  Thanks so much for humoring me, and I apologize as I get myself
familiarwith PostgreSQL and database concepts in general. <br /><br /><br />-Matt  

pgsql-hackers by date:

Previous
From: Lukas Kahwe Smith
Date:
Subject: OT: IRC nick to real world mapping
Next
From: Tom Lane
Date:
Subject: Safe outer-join orderings