Re: Varlena Type Creation - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Varlena Type Creation
Date
Msg-id 20080227221002.GA3956@svana.org
Whole thread Raw
In response to Varlena Type Creation  (Dimitri Fontaine <dfontaine@hi-media.com>)
Responses Re: Varlena Type Creation  (Dimitri Fontaine <dfontaine@hi-media.com>)
List pgsql-hackers
On Tue, Feb 26, 2008 at 06:19:48PM +0100, Dimitri Fontaine wrote:
> 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

I see no-one responded to this: a varlena has no fixed header size, so
you can't fit it in a structure anyway. Once you're passed a pointer
you use the LEN/PTR macros to extract what you want.

Not sure what the chars are for, but perhaps it would be easiest to
treat it as a single text object with the two leading characters
signifying something?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: new warning message
Next
From: Tom Lane
Date:
Subject: Re: new warning message