Re: ROLLBACK TO SAVEPOINT

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Sam Vilain <sam(at)vilain(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ROLLBACK TO SAVEPOINT
Date: 2010-05-25 10:18:37
Message-ID: 4BFBA3FD.7080407@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25/05/10 13:03, Florian Pflug wrote:
> On May 25, 2010, at 6:08 , Sam Vilain wrote:
>> 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'm confused. The sentence in brackets "Releasing the newer savepoint will cause the older one to again become accessible to ROLLBACK TO SAVEPOINT and RELEASE SAVEPOINT" implies that you *will* walk backwards through all the savepoints named "a" if you repeatedly issue "ROLLBACK TO SAVEPOINT a", no? If that is not how it actually works, then this whole paragraph is wrong, I'd say.

Releasing the newer savepoint will cause the older one to again become
accessible, as the doc says, but rolling back to a savepoint does not
implicitly release it. You'll have to use RELEASE SAVEPOINT for that.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2010-05-25 10:19:39 Re: Stefan's bug (was: max_standby_delay considered harmful)
Previous Message Simon Riggs 2010-05-25 10:12:55 Hot Standby performance and deadlocking