Re: Unstable C Function

Поиск
Список
Период
Сортировка
От Ian Campbell
Тема Re: Unstable C Function
Дата
Msg-id CA+0FpjXpZ6UGkSr=t6DYCBG9-vUcWjJJhRsMHiYr2O=h+8L1=w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Unstable C Function  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Unstable C Function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I'm going to rewrite it to use your tuplestore suggestion.

OK, so SPI is only suitable for single-call functions, right? If another function in the query attempted to use SPI, I assume there would be a deadlock?

Regards, Ian

On Thu, Sep 22, 2016 at 7:25 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Ian Campbell <ianrc72@gmail.com> writes:
> Thanks for personally replying, Tom. I appreciate it.
> You are correct. In the interim, I found the following change solved the
> issue:

> SPI_finish(); // move to here
> SRF_RETURN_DONE(funcctx);

That might work under light usage, but the problem with it is you're
blocking any other function in the same query from using SPI, since
you're leaving your own connection active when returning.  Sooner
or later that's gonna be a problem.

                        regards, tom lane

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

Предыдущее
От: Sylvain Marechal
Дата:
Сообщение: Re: Monitor pg_xlog size via SQL with postgres 9.4
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unstable C Function