Search Postgresql Archives

Re: spi in bgworker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> 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 I call
> 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?
> 

I have now. Thanks!

Is the documentation here a bit light because background workers are a new feature? Or is this general postgres knowledge I just haven't picked up on yet?

Could SPI_connect return an error rather than crashing?

Thanks again

James


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux