Search Postgresql Archives

Re: Unstable C Function

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

 



Ian Campbell <ianrc72@xxxxxxxxx> writes:
> OK, so SPI is only suitable for single-call functions, right?

It's usable by strictly nested functions, but a multi-call SRF is more
like a coroutine.

> If another
> function in the query attempted to use SPI, I assume there would be a
> deadlock?

No, the second arrival would get a SPI_ERROR_CONNECT failure from
SPI_connect when there's already an open connection.  For the nested-
calls case you can prevent that with SPI_push/SPI_pop around a call that
might wish to use SPI, but that fix doesn't work in a coroutine situation.

			regards, tom lane


-- 
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