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

From Zeugswetter Andreas SB SD
Subject Re: Nested Transactions, Abort All
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA40184D13E@m0114.s-mxs.net
Whole thread Raw
In response to Nested Transactions, Abort All  (Thomas Swan <tswan@idigx.com>)
List pgsql-hackers
> As far as implementing only savepoints, look at this:
>
> BEGIN;
>     BEGIN;
>     INSERT INTO ...;
>     COMMIT;
>     BEGIN;
>     INSERT INTO ...;
>     COMMIT;
>     BEGIN;
>     INSERT INTO ...;
>     COMMIT;
>
> With savepoints, it looks pretty strange:
>
> BEGIN;
>     SAVEPOINT x1;
>     INSERT INTO ...;
>     SAVEPOINT x2;

If you meant same as your nested example, it would be:

BEGIN TRANSACTION;SAVEPOINT x;INSERT INTO ...;SAVEPOINT x;    -- this implicitly commits previous subtxn xINSERT INTO
...;SAVEPOINTx;INSERT INTO ...; 
COMMIT;

Andreas


pgsql-hackers by date:

Previous
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: Nested Transactions, Abort All
Next
From: Andreas Pflug
Date:
Subject: Re: Nested Transactions, Abort All