Re: Saving bytes in custom data type - Mailing list pgsql-general

From Daniele Varrazzo
Subject Re: Saving bytes in custom data type
Date
Msg-id AANLkTikp2BYev8fZ34bPNZJWE61nTDtoc67iJfpJ6-9M@mail.gmail.com
Whole thread Raw
In response to Re: Saving bytes in custom data type  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
On Wed, Mar 16, 2011 at 6:29 PM, Merlin Moncure <mmoncure@gmail.com> wrote:

> question: if you are storing just flags and bytes, why not use a bytea
> and store the flags out of line?

I'm not sure I understand your question. I am writing a custom
datatype with variable size more or less following the guidelines in
<http://www.postgresql.org/docs/9.0/static/xtypes.html>.

More in details I am hacking at a GMP wrapper
<http://pgmp.projects.postgresql.org/> and trying to store GMP
bignums, which I can re-create by just storing a variable list of
unsigned longs and a flag for the sign (note that this is not the
structure the GMP library use, but is enough data to re-create it and
one of the possible form of storage as a varlena - I'm just exploring
to decide the best one).

What do you mean for storing the flag out of line?

-- Daniele

pgsql-general by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: query taking much longer since Postgres 8.4 upgrade
Next
From: Aleksey Tsalolikhin
Date:
Subject: Re: autovacuum issue after upgrade to 9.0.1