Re: Varlena Type Creation - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Varlena Type Creation
Date
Msg-id 200802281045.24156.dfontaine@hi-media.com
Whole thread Raw
In response to Re: Varlena Type Creation  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Le mercredi 27 février 2008, Martijn van Oosterhout a écrit :
> 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.

Once the type exists and the code gets some varlena kind type of objects to
play with, I think I'll use the same macros as for text usage... My problem
is more how to define a new "composite varlena", that is a new varlena type
composed of several base type...
I'm not sure I'm using a good vocabulary, please forgive me if it's all
unclear...

> Not sure what the chars are for

Maybe the input syntax would help getting what the chars are for.
To say a prefix range begins with '012' and any entry between '3' and '6',
you'd write e.g. '012[3-6]'::prefix_range. The chars are respectively '3'
and '6' and the greatest prefix of the prefix range is '012' here.

Here, '012[3-6]' @> '01234' is true but '012[3-6]' @> '0122' is false.

> , but perhaps it would be easiest to
> treat it as a single text object with the two leading characters
> signifying something?

I like your idea of using a single text datum for this and "encode" into it
the information I need: it makes it all simple for me to start working. But
still does not answer the question... not that the answer is needed any
more...

Thanks,
--
dim

pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: CREATE TABLE, load and freezing
Next
From: ITAGAKI Takahiro
Date:
Subject: Re: CREATE TABLE, load and freezing