Re: Nested transactions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Nested transactions
Дата
Msg-id 20920.1087573090@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Nested transactions  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Список pgsql-patches
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> I don't think we should explicitly forbid it.  I think it should be
> forbidden to close the outermost transaction inside a function (else the
> function would not be able to terminate correctly), but for levels
> before that one it'd be OK.

More specifically, a function cannot close any xact that was open when
it was called.  It can only close xacts that it started (or
equivalently, roll back to savepoints that it established).  Otherwise
the behavior is nonsensical.  Rollback of an outer transaction would
mean making like the function call never even happened, so the function
certainly couldn't expect to keep control.

            regards, tom lane

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

Предыдущее
От: Gavin Sherry
Дата:
Сообщение: Re: Tablespace patch review
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Nested transactions