Re: Transaction isolation with concurrent increments

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nico Erichsen <nico(dot)e(at)gmx(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Transaction isolation with concurrent increments
Date: 2002-06-04 23:21:05
Message-ID: 19981.1023232865@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Nico Erichsen <nico(dot)e(at)gmx(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-06-05 08:38:17 Bug #682: current_timestamp reporting time incorrectly
Previous Message Tom Lane 2002-06-03 23:33:41 Re: Should the optimizer optimize "current_date - interval '1 days'" (fwd)