Varlena Type Creation - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Varlena Type Creation
Date
Msg-id 200802261819.51401.dfontaine@hi-media.com
Whole thread Raw
Responses Re: Varlena Type Creation  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Hi,

I'm working on a GiST opclass to support prefix searching as presented here:
http://pgsql.tapoueh.org/site/html/prefix/index.htmlhttp://prefix.projects.postgresql.org/README.html
http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/prefix/prefix/

In order to have a much more efficient index, I received the advice to
implement a prefix range datatype then base the picksplit() and union()
implementation on top of it.

So... where do I start to create a varlena datatype which has to store the 3
following values: text prefix, char start, char end.

It's not clear for me whether this is what I need to provide:

typedef struct
{   int32    vl_len_;   char    start;   char    end;   text        prefix;
} prefix_range;

In particular, I've been taught a varlena definition can not contain pointers,
and I've no idea how to embed a text into another varlena...

Regards,
--
dim

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: pg_dump additional options for performance
Next
From: Andrew Dunstan
Date:
Subject: Re: Including PL/PgSQL by default