Re: Writing values to relation using bytearray ...

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Writing values to relation using bytearray ...
Дата
Msg-id 4136ffa0903060407l4318eac0q4553b264719180fb@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Writing values to relation using bytearray ...  (Greg Stark <stark@enterprisedb.com>)
Список pgsql-hackers
On Fri, Mar 6, 2009 at 12:01 PM, Greg Stark <stark@enterprisedb.com> wrote:
> 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.

Actually on further thought I think I would suggest just storing the
whole datum for all typbyval types setting your bytea length to
SIZEOF_DATUM.

And use datumGetSize() for non-typbyval datums. Assuming you have
typbyval and typlen handy.

-- 
greg


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andreas 'ads' Scherbaum
Дата:
Сообщение: Re: Validating problem in the isn contrib module
Следующее
От: Zdenek Kotala
Дата:
Сообщение: [PATCH] Regression test fix for Czech locale