ROLLBACK TO SAVEPOINT - Mailing list pgsql-hackers

From Sam Vilain
Subject ROLLBACK TO SAVEPOINT
Date
Msg-id 4BFB4D46.9050400@vilain.net
Whole thread Raw
Responses Re: ROLLBACK TO SAVEPOINT
List pgsql-hackers
The note at the end of;

http://www.postgresql.org/docs/8.4/static/sql-savepoint.html

Lead us to believe that if you roll back to the same savepoint name
twice in a row, that you might start walking back through the
savepoints.  I guess I missed the note on ROLLBACK TO SAVEPOINT that
that is not how it works.

Here is the section:

SQL requires a savepoint to be destroyed automatically when another
savepoint with the same name is established. In PostgreSQL, the old
savepoint is kept, though only the more recent one will be used when
rolling back or releasing. (Releasing the newer savepoint will cause the
older one to again become accessible to ROLLBACK TO SAVEPOINT and
RELEASE SAVEPOINT.) Otherwise, SAVEPOINT is fully SQL conforming.

I think it could be improved by also communicating:

Rollback to a savepoint never releases it; you can safely repeat
ROLLBACK TO SAVEPOINT statements without unwinding the transaction, even
if you are re-using savepoint names.

Well, maybe no-one else will ever have the misconception I did, but
there it is.

Sam.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: unnailing shared relations (was Re: global temporary tables)
Next
From: Fujii Masao
Date:
Subject: Re: Synchronization levels in SR