Skip site navigation (1) Skip section navigation (2)

Re: Nested Transactions, Abort All

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Nested Transactions, Abort All
Date: 2004-07-02 17:22:38
Message-ID: 20040702172238.GC26372@dcc.uchile.cl (view raw or flat)
Thread:
Lists: pgsql-hackers
On Fri, Jul 02, 2004 at 01:14:25PM -0400, Merlin Moncure wrote:
> > If we change the syntax, say by using SUBCOMMIT/SUBABORT for
> > subtransactions, then using a simple ABORT would abort the whole
> > transaction tree.
> 
> Question: with the new syntax, would issuing a BEGIN inside a already
> started transaction result in an error?

Yes.

> My concern is about say, a pl/pgsql function that opened and closed a
> transation.  This could result in different behaviors depending if
> called from within a transaction, which is not true of the old syntax.  
> 
> Then again, since a statement is always transactionally wrapped, would
> it be required to always issue SUBBEGIN if issued from within a
> function?  This would address my concern.

Yes, I was thinking about this because the current code behaves wrong if
a BEGIN is issued and not inside a transaction block.  So we'd need to
do something special in SPI -- not sure exactly what, but the effect
would be that the function can't issue BEGIN at all and can only issue
SUBBEGIN.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
A male gynecologist is like an auto mechanic who never owned a car.
(Carrie Snow)


In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2004-07-02 17:24:00
Subject: Re: Subtle bug in clog.c
Previous:From: Merlin MoncureDate: 2004-07-02 17:22:31
Subject: Re: anonymous cvs failure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group