Re: SPI: Correct way to rollback a subtransaction?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SPI: Correct way to rollback a subtransaction?
Дата
Msg-id 29559.1140477600@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SPI: Correct way to rollback a subtransaction?  ("Marko Kreen" <markokr@gmail.com>)
Ответы Re: SPI: Correct way to rollback a subtransaction?  ("Marko Kreen" <markokr@gmail.com>)
Список pgsql-hackers
"Marko Kreen" <markokr@gmail.com> writes:
> On 2/20/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> This seems like a pretty bad idea: if the SPI_connect fails you lose
>> control without having unwound the subtransaction.  That's unlikely,
>> but still wrong.

> But if I want the error to reach upper transaction?  SPI_connect
> failure does not seem a 'expected' situation to me.

In that case you should put the SPI_connect and later SPI_finish
*outside* the subtransaction and TRY block.  And you'll need
SPI_restore_connection I think.  This structure would be exactly
parallel to the way pl_exec.c does it.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: dropped columns, tupDesc
Следующее
От: "Sergey E. Koposov"
Дата:
Сообщение: Re: dropped columns, tupDesc