Re: Writing values to relation using bytearray ...

From: Greg Stark <stark(at)enterprisedb(dot)com>
To: Kedar Potdar <kedar(dot)potdar(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Writing values to relation using bytearray ...
Date: 2009-03-06 12:01:26
Message-ID: 4136ffa0903060401i26746f42i2e79c9ce1bb22479@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 6, 2009 at 11:41 AM, Kedar Potdar <kedar(dot)potdar(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas 'ads' Scherbaum 2009-03-06 12:03:06 Re: Validating problem in the isn contrib module
Previous Message Bernd Helmle 2009-03-06 11:44:31 Re: Validating problem in the isn contrib module