Re: Writing values to relation using bytearray ... - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Writing values to relation using bytearray ...
Date
Msg-id 4136ffa0903060401i26746f42i2e79c9ce1bb22479@mail.gmail.com
Whole thread Raw
In response to Re: Writing values to relation using bytearray ...  (Kedar Potdar <kedar.potdar@gmail.com>)
Responses Re: Writing values to relation using bytearray ...  (Greg Stark <stark@enterprisedb.com>)
List pgsql-hackers
On Fri, Mar 6, 2009 at 11:41 AM, Kedar Potdar <kedar.potdar@gmail.com> wrote:
> Thanks Greg, for showing interest.
>
> The problem here is I need to store values of different types into bytearray
> column of relation.

Oh, hm. I think you need to look at typlen instead of typbyval.

But you have an additional problem for typbyval types: the pointer to
Datum isn't necessarily pointing at the right bytes. I think you have
to use the GET_[1248]_BYTES macros depending on typlen. There may be a
helper function for this but I don't know of one.


-- 
greg


pgsql-hackers by date:

Previous
From: Bernd Helmle
Date:
Subject: Re: Validating problem in the isn contrib module
Next
From: Andreas 'ads' Scherbaum
Date:
Subject: Re: Validating problem in the isn contrib module