Re: Transaction isolation with concurrent increments - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Transaction isolation with concurrent increments
Date
Msg-id 19981.1023232865@sss.pgh.pa.us
Whole thread Raw
In response to Transaction isolation with concurrent increments  (Nico Erichsen <nico.e@gmx.de>)
List pgsql-bugs
Nico Erichsen <nico.e@gmx.de> writes:
>     set transaction isolation level serializable;
>     begin;
>     update counters set counter1=(select counter1+1 from counters);

Try it the other way round:

     begin;
     set transaction isolation level serializable;
     update counters set counter1=(select counter1+1 from counters);

Isolation level is a transaction-local setting so the first way doesn't
affect the level the BEGIN block actually uses.  (There is a SET
variable to change the default level for future transactions, but that
ain't what you set here.)

            regards, tom lane

pgsql-bugs by date:

Previous
From: Nico Erichsen
Date:
Subject: Transaction isolation with concurrent increments
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #682: current_timestamp reporting time incorrectly