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

From Zeugswetter Andreas SB SD
Subject Re: Nested Transactions, Abort All
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA40184D13D@m0114.s-mxs.net
Whole thread Raw
In response to Nested Transactions, Abort All  (Thomas Swan <tswan@idigx.com>)
List pgsql-hackers
> My proposal would be:
>
> 1. Begin main transaction: BEGIN { TRANSACTION | WORK }
> 2. Commit main (all) transaction: COMMIT { TRANSACTION | WORK }
> 3. Rollback main (all) transaction: ROLLBACK { TRANSACTION }
>
> 4. Begin inner transaction: BEGIN NESTED { TRANSACTION | WORK }
> 5. Commit inner transaction: COMMIT NESTED { TRANSACTION | WORK }
> 6. Rollback inner transaction: ROLLBACK NESTED { TRANSACTION }
>
>
> 1, 2 and 3 are not negotiable.  4, 5 and 6 are.

Hmm, 1-3 are at least negotiable for the abbreviated form 'BEGIN'
and 'END'. I think we could differentiate those.
The standard only has 'BEGIN TRANSACTION' and 'COMMIT [WORK]'
and 'ROLLBACK [WORK]'. I agree that we are not allowed to change
the semantics of those non abbreviated forms.

How about:
1. Begin main tx: BEGIN WORK | BEGIN TRANSACTION
2. Commit main (all) transaction: COMMIT [ TRANSACTION | WORK ]
3. Rollback main (all) transaction: ROLLBACK [ TRANSACTION | WORK ]

4. BEGIN: starts eighter a main or a subtransaction (for plsql BEGIN SUB)
5. END: commits nested, maybe also abort a nested tx that is already in abort state (for plsql END SUB)
6. ROLLBACK SUB[TRANSACTION]: rolls subtx back

Andreas


pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Weird new time zone
Next
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: Nested Transactions, Abort All