Re: SAVEPOINT and FOR UPDATE

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: SAVEPOINT and FOR UPDATE
Дата
Msg-id 87vep8qf68.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: SAVEPOINT and FOR UPDATE  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: SAVEPOINT and FOR UPDATE  (Scott Marlowe <smarlowe@g2switchworks.com>)
Список pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> "Thomas F. O'Connell" <tfo@sitening.com> writes:
> > I sort of expected the release of the savepoint to be tantamount to a
> > commit of the subtransaction, but it doesn't appear to have been.
>
> But you still haven't committed the outer transaction: rolling it back
> must undo the effects of the subtransaction, no?  So a "release" merely
> destroys the separate identity of the subtransaction and assigns all its
> effects (including locks) to the parent transaction.

There seems to be a recurring confusion between subtransactions and autonomous
transactions. Perhaps there should be a caveat in the SAVEPOINT documentation
explaining that they aren't autonomous transactions and the work inside the
savepoint is still subject to the regular transaction semantics for the
outermost transaction and isn't actually committed until the outer transaction
commits.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

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

Предыдущее
От: "Matthew T. O'Connor"
Дата:
Сообщение: Re: PITR Questions
Следующее
От: "Germán Hüttemann Arza"
Дата:
Сообщение: PostgreSQL Internals