Re: Nested Transactions, Abort All

Поиск
Список
Период
Сортировка
От Andreas Pflug
Тема Re: Nested Transactions, Abort All
Дата
Msg-id 40EE7E40.1020804@pse-consulting.de
обсуждение исходный текст
Ответ на Re: Nested Transactions, Abort All  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
Список 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 по дате отправления:

Предыдущее
От: "Zeugswetter Andreas SB SD"
Дата:
Сообщение: Re: Nested Transactions, Abort All
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: patch for allowing multiple -t options to pg_dump