Re: Nested transactions - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Nested transactions
Date
Msg-id 200406170203.i5H23F801739@candle.pha.pa.us
Whole thread Raw
In response to Re: Nested transactions  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-patches
Christopher Kings-Lynne wrote:
> > And consider this case:
> >
> >     BEGIN;
> >     ...
> >     SAVEPOINT x;
> >     SELECT func_call();
> >     SELECT func_call();
> >     COMMIT;
> >
> > Now if func_call has a savepoint, it is really nested because it can't
> > know whether the savepoint X will be used to roll back, so its status is
> > dependent on the status of X.  Now, if we used savepoints in func_call,
> > what happens in the second function call when we define a savepoint with
> > the same name?  I assume we overwrite the original, but using nested
> > transaction syntax seems much clearer.
>
> It also seems in this example that func_call() probably shouldn't have
> permission to rollback to savepoint x?  Otherwise it would get...weird.

Yes, weird.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Nested transactions
Next
From: Bruce Momjian
Date:
Subject: Re: Nested transactions