pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: Barry Lind <blind@xythos.com>
Cc: simon@2ndquadrant.com
Cc: Patches <pgsql-patches@postgresql.org>
Cc: alvherre@dcc.uchile.cl
Subject: Re: Nested transactions
Date: Wed, 16 Jun 2004 22:03:15 -0400 (EDT)
Message-ID: <200406170203.i5H23F801739@candle.pha.pa.us> (raw)
In-Reply-To: <40D0FB7C.8030309@familyhealth.com.au>

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



view thread (19+ messages)  latest in thread

Message-ID: <200406170203.i5H23F801739@candle.pha.pa.us>
Permalink:  ../200406170203.i5H23F801739@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200406170203.i5H23F801739@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: pgman@candle.pha.pa.us, chriskl@familyhealth.com.au, blind@xythos.com, simon@2ndquadrant.com, pgsql-patches@postgresql.org, alvherre@dcc.uchile.cl
  Subject: Re: Nested transactions
  In-Reply-To: <200406170203.i5H23F801739@candle.pha.pa.us>
  References: <40D0FB7C.8030309@familyhealth.com.au> <200406170203.i5H23F801739@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox