| От | Tom Lane |
|---|---|
| Тема | Re: calling plpgsql from c |
| Дата | |
| Msg-id | 22673.1069437440@sss.pgh.pa.us обсуждение |
| Ответ на | calling plpgsql from c (Max Jacob <Max.Jacob@ircam.fr>) |
| Ответы |
Re: calling plpgsql from c
|
| Список | pgsql-hackers |
Max Jacob <Max.Jacob@ircam.fr> writes:
> I'm trying to call plpgsql functions from c functions directly through
> the Oid, but i have a problem: it seems that the plpgsql interpreter
> calls SPI_connect and fails even if the caller has already
> spi-connected.
This is a safety check. If you are connected to SPI, you need to call
SPI_push() and SPI_pop() around any operation that might involve
recursive use of SPI. That helps delimit "your" calls versus "their"
calls versus "no man's land".
It does seem that this is quite undocumented though. Jan?
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера