Re: Nested Transactions, Abort All

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested Transactions, Abort All
Date: 2004-07-12 00:32:11
Message-ID: 20040712003211.GA8483@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jul 11, 2004 at 03:15:46PM -0700, Josh Berkus wrote:

> For that matter:
>
> begin;
> savepoint;
> select 0/0; -- abort
> savepoint; -- commands will be ignored
> select 1; -- commands will be ignored
> release; -- commands will be ignored
> release; -- abort main xact 'cause we didn't rollback
> commit; -- abort message
>
> Is the above more or less correct, Alvaro?

Save a minor detail. It would be

begin;
savepoint;
select 0/0; -- abort
savepoint; -- commands will be ignored
select 1; -- commands will be ignored
release; -- commands will be ignored
release; -- commands will be ignored
commit; -- abort message

Note that I'm trying to tell you something with the indenting; all those
commands are inside one and the same subtransaction.

And I'm not planning to do anonymous savepoint. Do these buy us
anything?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Find a bug in a program, and fix it, and the program will work today.
Show the program how to find and fix a bug, and the program
will work forever" (Oliver Silfridge)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-07-12 00:40:19 Re: Nested Transactions, Abort All
Previous Message Bruce Momjian 2004-07-11 23:23:13 Re: [Re] Re: PREPARE and transactions