Re: Nested Transactions, Abort All - Mailing list pgsql-hackers

From Dennis Bjorklund
Subject Re: Nested Transactions, Abort All
Date
Msg-id Pine.LNX.4.44.0407100758260.2838-100000@zigo.dhs.org
Whole thread Raw
In response to Re: Nested Transactions, Abort All  (Mike Rylander <miker@purplefrog.com>)
Responses Re: Nested Transactions, Abort All  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: User Quota Implementation
Next
From: Gavin Sherry
Date:
Subject: Re: Nested Transactions, Abort All