question about API to b-tree in PG

From: GeGeZ <gegez-pgh(at)instytut(dot)com(dot)pl>
To: pgsql-hackers(at)postgresql(dot)org(dot)
Subject: question about API to b-tree in PG
Date: 2004-03-08 15:28:05
Message-ID: 404C9105.3060307@instytut.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,
this is my first post, so "Hello" again :)
I have a problem. I am trying to create another implementation of FTI in
PG. What will be different? I am going to create my new index on text
type field:
CREATE TABLE test (id int, mytext text);
CREATE INDEX myindex on test USING myindex (mytext) ;

The myindex index will be just ordinary postgresql's btree on tokenized
text (so before inserting into btree, I will tokenize text, and then I
will insert every found token). I mean, instead of keeping text in
index, I will keep terms from tokenized column mytext. So:
insert INTO test(1,'this is my first text');
In index I would like to keep following objects: 'this', 'is', 'my',
'first', 'text'.

My question is how to access btree index using API (not by operators,
etc.). Espiecialy, I need following functions:
create "empty" btree index (I do not know how to create index without
table connected to it)
insert tuple
remove tuple
destroy index
find term in btree index.

Is there any manual to btree API?

I found only pure C source files:
src/backend/access/index and src/backend/access/nbtree.

Sorry for my poor English,
Yours,
Gegez

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-08 15:44:05 Re: IN joining
Previous Message Tom Lane 2004-03-08 14:52:58 Re: avg() for timestamp