Re: Nested Transactions, Abort All - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Nested Transactions, Abort All
Date
Msg-id 20040705234228.GA29515@dcc.uchile.cl
Whole thread Raw
In response to Re: Nested Transactions, Abort All  (Thomas Swan <tswan@idigx.com>)
Responses Re: Nested Transactions, Abort All
Re: Nested Transactions, Abort All
List pgsql-hackers
On Sat, Jul 03, 2004 at 02:32:44AM -0500, Thomas Swan wrote:
> Alvaro Herrera wrote:

> >What I'd like to do is start the transaction block before the function
> >is called if we are not in a transaction block.  This would mean that
> >when the function calls BEGIN it won't be the first one -- it will
> >actually start a subtransaction and will be able to end it without harm.
> >I think this can be done automatically at the SPI level.
>
> Please tell me there is some sanity in this.   If I follow you
> correctly, at no point should anyone be able to issue an explicit
> begin/end because they are already in an explicit/implicit transaction
> by default...  How is the user/programmer to know when this is the case?

I'm not sure I understand you.  Of course you can issue begin/end.  What
you can't do is issue begin/end inside a function -- you always use
subbegin/subcommit in that case.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La espina, desde que nace, ya pincha" (Proverbio africano)



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql-server: plperl update from Andrew Dunstan, deriving (I believe)
Next
From: "Marc G. Fournier"
Date:
Subject: Re: compile errors in new PL/Pler