Re: BUG #5883: Error when mixing SPI_returntuple with returning regular HeapTuple
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #5883: Error when mixing SPI_returntuple with returning regular HeapTuple |
| Дата | |
| Msg-id | 25635.1297701547@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | BUG #5883: Error when mixing SPI_returntuple with returning regular HeapTuple ("" <vegard.bones@met.no>) |
| Ответы |
Re: BUG #5883: Error when mixing SPI_returntuple with
returning regular HeapTuple
|
| Список | pgsql-bugs |
"" <vegard.bones@met.no> writes:
> When creating a server-side C function, things go wrong when I (in the same
> function) return some results via SPI_returntuple, and other results by
> manually creating HeapTuples. This applies even if the source for both
> returns are the same data in the same table.
I think the part of this example that doesn't work is returning from the
function without having exited your SPI context. If you need to produce
multiple rows from a single SPI query, the best solution is to collect
them all during a single call and return them in a tuplestore. You can
*not* return without having called SPI_finish to balance your
SPI_connect.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера