Dear postgresql hackers,

I'm trying to find out what happens if I use nested transactions in
postgresql from 7.2.x to 7.4.x. I visited and surfed across many webpages
and documents but I did not find anything (I did not look at the sources
yet).  I know nested transactions did not work on that versions, but this
is exactly what I want to know. What happens if I put nested begins,
commits, etc? Suppose we have the following:

begin work
...
begin work
...
commit
...
commit

What happens with the second begin? What happens in the first and second
commits? And if I put a rollback inside the two nested transactions? What
happens? Thank you in advance,

[]'s

cassio.


Sun, 9 May 2004 10:57:45 -0300 (BRT)
Cassio Polpo de Campos <cassio@ime.usp.br>
Nested transactions
On Sun, May 09, 2004 at 10:57:45AM -0300, Cassio Polpo de Campos wrote:

> I know nested transactions did not work on that versions, but this
> is exactly what I want to know. What happens if I put nested begins,
> commits, etc? Suppose we have the following:
> 
> begin work
> ...
> begin work
> ...
> commit
> ...
> commit

You'll get a warning in the second begin saying that you already are in
a transaction, and nothing will happen.  The first commit will commit,
and the second one will get another warning saying that you are not on a
transaction and there's nothing to commit.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Siempre hay que alimentar a los dioses, aunque la tierra estï¿½ seca" (Orual)

Sun, 9 May 2004 10:59:31 -0400
Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: Nested transactions