Re: Unstable C Function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unstable C Function
Дата
Msg-id 27894.1474562481@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Unstable C Function  (Ian Campbell <ianrc72@gmail.com>)
Список pgsql-general
Ian Campbell <ianrc72@gmail.com> 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


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

Предыдущее
От: Ian Campbell
Дата:
Сообщение: Re: Unstable C Function
Следующее
От: Rafia Sabih
Дата:
Сообщение: Re: Question about "grant create on database" and pg_dump/pg_dumpall