RE: Re: function crashes backend

Поиск
Список
Период
Сортировка
От Mikheev, Vadim
Тема RE: Re: function crashes backend
Дата
Msg-id 8F4C99C66D04D4118F580090272A7A23018D1C@SECTORBASE1
обсуждение исходный текст
Ответ на function crashes backend  (Louis-David Mitterrand <cunctator@apartia.ch>)
Список pgsql-hackers
> Following up to myself, I finally understood my problem: I 
> was trying to
> re-use SPI_tuptable->vals[i] after calling SPI_exec() on another,
> unrelated query. So the backend crash makes perfect sense now.
> 
> What is the best strategy: 
> - store the result of a SELECT returning multiple tuples into a local
>   SPITupleTable? How do I allocate memory for that?

You can just save SPITupleTable pointer somewhere before running another
query. SPI doesn't free tuple table between queries but creates new one
for each select query.

Vadim


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

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Recovery from hard drive failure ... the hard way ...
Следующее
От: "Mikheev, Vadim"
Дата:
Сообщение: RE: pgsql is 75 times faster with my new index scan