Re: spi in bgworker

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: spi in bgworker
Дата
Msg-id 20140322234927.GA12094@eldon.alvh.no-ip.org
обсуждение исходный текст
Ответ на spi in bgworker  (James Harper <james.harper@bendigoit.com.au>)
Ответы Re: spi in bgworker  (James Harper <james.harper@bendigoit.com.au>)
Список pgsql-general
James Harper wrote:
> The docs say I'm supposed to call BackgroundWorkerInitializeConnection in a bgworker and then I can start using spi
functions,but they aren't clear on if I should call SPI_connect too. 
>
> If I call BackgroundWorkerInitializeConnection and then SPI_execute I get a return code of SPI_ERROR_UNCONNECTED. If
Icall BackgroundWorkerInitializeConnection then SPI_connect I get a segfault. 

You need to start a transaction after initializing the database
connection.  Did you see the sample worker_spi code in contrib?

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: James Harper
Дата:
Сообщение: spi in bgworker
Следующее
От: James Harper
Дата:
Сообщение: Re: spi in bgworker