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

From Andreas Pflug
Subject Re: Nested Transactions, Abort All
Date
Msg-id 40EE7E40.1020804@pse-consulting.de
Whole thread Raw
In response to Re: Nested Transactions, Abort All  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
List pgsql-hackers
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




pgsql-hackers by date:

Previous
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: Nested Transactions, Abort All
Next
From: Andreas Joseph Krogh
Date:
Subject: patch for allowing multiple -t options to pg_dump