pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@dcc.uchile.cl>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Barry Lind <blind@xythos.com>
Cc: simon@2ndquadrant.com
Cc: Patches <pgsql-patches@postgresql.org>
Subject: Re: Nested transactions
Date: Wed, 16 Jun 2004 21:58:42 -0400
Message-ID: <20040617015842.GB5925@dcc.uchile.cl> (raw)
In-Reply-To: <200406170136.i5H1aX727064@candle.pha.pa.us>
References: <40D0ECFF.2070501@xythos.com>
	<200406170136.i5H1aX727064@candle.pha.pa.us>

On Wed, Jun 16, 2004 at 09:36:33PM -0400, Bruce Momjian 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?

Hm, that's a good question.  What happens if you define two savepoints
with the same name?  According to SQL2003, the previous savepoint "is
destroyed", but it's not clear to me whether this means rolling back all
of its changes or just forgetting it.  What's clear is that you can roll
back only to the latest one.

Also, in SQL2003 there can be multiple "savepoint levels".  I think for
a first implementation it would be fine if we had only one level.  It
would, wouldn't it?

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Estoy de acuerdo contigo en que la verdad absoluta no existe...
El problema es que la mentira sí existe y tu estás mintiendo" (G. Lama)




view thread (19+ messages)  latest in thread

Message-ID: <20040617015842.GB5925@dcc.uchile.cl>
Permalink:  ../20040617015842.GB5925@dcc.uchile.cl/
Also on:    postgresql.org/message-id/20040617015842.GB5925@dcc.uchile.cl

 · 

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: alvherre@dcc.uchile.cl, pgman@candle.pha.pa.us, blind@xythos.com, simon@2ndquadrant.com, pgsql-patches@postgresql.org
  Subject: Re: Nested transactions
  In-Reply-To: <20040617015842.GB5925@dcc.uchile.cl>
  References: <40D0ECFF.2070501@xythos.com> <200406170136.i5H1aX727064@candle.pha.pa.us> <20040617015842.GB5925@dcc.uchile.cl>

* 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