Re: How to detoast a column of type BYTEAOID

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: How to detoast a column of type BYTEAOID
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B53840C16@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на How to detoast a column of type BYTEAOID  (<david@andl.org>)
Ответы Re: How to detoast a column of type BYTEAOID  (<david@andl.org>)
Re: How to detoast a column of type BYTEAOID  ("David Bennett" <david@yorkage.com>)
Список pgsql-general
david@andl.org wrote:
> I am attempting to create a new language implementation. The language is
> Andl (andl.org), so the handler is plandl.
> I am having a bit of trouble executing SPI queries from inside plandl.
> 
> The particular problem arises after calling SPI_cursor_fetch() and then
> SPI_getbinval() on a column of type BYTEA (BYTEAOID 17). I was expecting to
> get back a Datum of type bytea, but the length is crazy. From the look of
> the data, I suspect that what I have is a compressed TOAST, and I don't know
> how to handle those.
> 
> 1. Does SPI_getbinval() indeed return compressed TOAST values?
> 2. If so, what should I do (in general) to ensure the values I retrieve are
> de-toasted?

You should use the PG_DETOAST_DATUM* macros from fmgr.h; see the documentation there.

Yours,
Laurenz Albe

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Enhancement request for pg_dump
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: what's the exact command definition in read committed isolation level?