Re: SPI Interface to Call Procedure with Transaction Control Statements?

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: SPI Interface to Call Procedure with Transaction Control Statements?
Дата
Msg-id 87va2qkxkg.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: SPI Interface to Call Procedure with Transaction Control Statements?  (Jack LIU <toliujiayi@gmail.com>)
Ответы Re: SPI Interface to Call Procedure with Transaction ControlStatements?  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
>>>>> "Jack" == Jack LIU <toliujiayi@gmail.com> writes:

 Jack> Hi Andrew,
 Jack> This is my code to call the procedure with
 Jack> SPI_connect_ext(SPI_OPT_NONATOMIC).

Ah. You need to take a look at exec_stmt_call in plpgsql, and do the
same things it does with snapshot management (specifically, setting the
no_snapshot flag on the plan that you're going to execute). SPI forces
atomic mode if the normal snapshot management is in use, because
otherwise a commit inside the procedure would warn about still having a
snapshot open.

-- 
Andrew (irc:RhodiumToad)


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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Log a sample of transactions
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: SPI Interface to Call Procedure with Transaction ControlStatements?