
> I'd opt for BEGIN as a start of a subtransaction (no need for special 
> semantics in plpgsql), the corresponding END simply changes the 
> transaction context to the parent level.

But 'BEGIN' in plpgsql does not start a [sub]transaction, it starts a 
statement block. Are we intending to change that ? I think not.

Andreas

Fri, 9 Jul 2004 12:59:57 +0200
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>
Re: Nested Transactions, Abort All
Zeugswetter Andreas SB SD wrote:

>>I'd opt for BEGIN as a start of a subtransaction (no need for special 
>>semantics in plpgsql), the corresponding END simply changes the 
>>transaction context to the parent level.
>>    
>>
>
>But 'BEGIN' in plpgsql does not start a [sub]transaction, it starts a 
>statement block. Are we intending to change that ? I think not.
>
>  
>
There are two possibilities:
Either BEGIN *does* start a subtransaction, or BEGIN does not. I don't 
see how two nesting level hierarchies in a function should be 
handleable, i.e. having independent levels of statements blocks and 
subtransactions.

BEGIN [whatever] suggests that there's also a statement closing that 
block of [whatever], but it's very legal for subtransactions to have no 
explicit end; the top level COMMIT does it all.

The SAVEPOINT semantic seems much more appropriate to describe statement 
block independent transactions in this case, so if both is implemented 
for SQL, savepoint only seems enough for plpgsql.

Regards,
Andreas



Fri, 09 Jul 2004 13:15:12 +0200
Andreas Pflug <pgadmin@pse-consulting.de>
Re: Nested Transactions, Abort All