Re: Problem with Numerics multiplication in C-function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem with Numerics multiplication in C-function
Дата
Msg-id 16363.1249309236@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Problem with Numerics multiplication in C-function  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Problem with Numerics multiplication in C-function
Список pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> What you need to do is copy the Datum you wish to return into the upper
> memory context. I'm not seeing a helpful SPI utility function or
> obvious example here you help you, but I'm sure it's something with
> MemoryContextSwitchTo() and datumCopy().

SPI_palloc is what to use to allocate the result in the right place.

My guess is that the reason the function appeared to work (most of the
time) before is that it wasn't being tested in an assert-enabled build.
CLOBBER_FREED_MEMORY is exposing the mistake.

            regards, tom lane

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

Предыдущее
От: "Chris Black"
Дата:
Сообщение: Out of Office AutoReply: Never thought he would be able
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: synchronous_commit=off doesn't always return immediately