Re: Preventing tuple-table leakage in plpgsql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Preventing tuple-table leakage in plpgsql
Дата
Msg-id 5064.1374419589@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Preventing tuple-table leakage in plpgsql  (Noah Misch <noah@leadboat.com>)
Список pgsql-hackers
Noah Misch <noah@leadboat.com> writes:
> On Thu, Jul 11, 2013 at 09:14:38PM -0400, Chad Wagner wrote:
>> Should SPI_connect be called again after the subtransaction is created?  And
>> SPI_finish before the subtransaction is committed or aborted?

> Hmm.  An SPI_push()+SPI_connect() every time PL/pgSQL starts a subtransaction
> would be another way to fix it, yes.

That sounds like a dangerous idea to me.  The procedure would then be
working actively with queries from two different SPI levels, which I'm
pretty sure would cause issues.  It's possible that plpgsql's SPI access
is sufficiently lexically-local that statements within the BEGIN block
couldn't use any SPI resources created by statements outside it nor vice
versa.  But then again maybe not, and in any case we couldn't imagine
that that would be a workable restriction for non-plpgsql scenarios.
        regards, tom lane



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

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: Preventing tuple-table leakage in plpgsql
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Preventing tuple-table leakage in plpgsql