Re: Problem with Numerics multiplication in C-function
От | Martijn van Oosterhout |
---|---|
Тема | Re: Problem with Numerics multiplication in C-function |
Дата | |
Msg-id | 20090803144403.GA7352@svana.org обсуждение исходный текст |
Ответ на | Re: Problem with Numerics multiplication in C-function (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Problem with Numerics multiplication in C-function
Re: Problem with Numerics multiplication in C-function |
Список | pgsql-general |
On Mon, Aug 03, 2009 at 10:20:36AM -0400, Tom Lane wrote: > 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. Ofcourse, and then a memcpy(). I was distracted by the fact there is an SPI_copy/returntuple(), but no SPI_returndatum(). It might actually be helpful to include in the documentation an example of returning from a function a result from SPI, since it's not entirely obvious. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Please line up in a tree and maintain the heap invariant while > boarding. Thank you for flying nlogn airlines.
Вложения
В списке pgsql-general по дате отправления: