| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера