Re: Nested Transactions, Abort All

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Mike Rylander <miker(at)purplefrog(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested Transactions, Abort All
Date: 2004-07-10 06:11:51
Message-ID: Pine.LNX.4.44.0407100758260.2838-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 9 Jul 2004, Mike Rylander wrote:

> Nested transactions and savepoints serve two different purposes. They have
> some overlap, but for the most part solve two distinct problems.

Then show some examples that illustrait the difference. So far all
examples shown that uses subtransactions could just as well have been
written using savepoints.

I don't agree that they have two different purposes.

> I don't think so, especially as there has been some talk of implimenting
> savepoints as a subset of nested transactions.

It is not a subset. It's the other way around. Nested transactions are a
subset of savepoints

Savepoints have more possibilities, you can invalidate older savepoints
then the last (with subtransactions you can only commit/rollback the
last). If you don't use that then it's exactly the same as
subtransactions.

The only "feature" subtransactions have that savepoints doesn't is the
lack of names. Every savepoint have a name. If we want an extension it
could be to get the database to generate a fresh savepoint name. The
client can of course also generate unique savepoint names if it want.

That subtransactions do more than savepoints is just smoke an mirrors. So
far there have been no example to validate that point of view, and I don't
think there will be any. If anyone know of something that you can do with
subtransactions and not with savepoints, please speak up.

--
/Dennis Björklund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Sherry 2004-07-10 06:49:45 Re: Nested Transactions, Abort All
Previous Message Jonah H. Harris 2004-07-10 06:05:11 Re: User Quota Implementation