Re: SAVEPOINT and FOR UPDATE

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Gregory Stark <gsstark(at)mit(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Thomas F(dot) O'Connell" <tfo(at)sitening(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: SAVEPOINT and FOR UPDATE
Date: 2006-08-07 20:09:24
Message-ID: 1154981364.20252.33.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2006-08-04 at 18:01, Gregory Stark wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> > "Thomas F. O'Connell" <tfo(at)sitening(dot)com> writes:
> > > I sort of expected the release of the savepoint to be tantamount to a
> > > commit of the subtransaction, but it doesn't appear to have been.
> >
> > But you still haven't committed the outer transaction: rolling it back
> > must undo the effects of the subtransaction, no? So a "release" merely
> > destroys the separate identity of the subtransaction and assigns all its
> > effects (including locks) to the parent transaction.
>
> There seems to be a recurring confusion between subtransactions and autonomous
> transactions. Perhaps there should be a caveat in the SAVEPOINT documentation
> explaining that they aren't autonomous transactions and the work inside the
> savepoint is still subject to the regular transaction semantics for the
> outermost transaction and isn't actually committed until the outer transaction
> commits.

Note that one CAN get autonomous transactions using dblink. I've used
it once or twice in the past to do that.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Vallar 2006-08-07 20:12:57 Re: Dumping database using 8.1 or 7.1
Previous Message Ron Johnson 2006-08-07 20:07:34 Re: Practical maximums (was Re: PostgreSQL theoretical