A simple question about Read committed isolation level

From: weiping he <laser(at)qmail(dot)zhengmai(dot)net(dot)cn>
To: pgsql-general(at)postgresql(dot)org
Subject: A simple question about Read committed isolation level
Date: 2004-04-01 15:26:16
Message-ID: 406C3498.3010703@qmail.zhengmai.net.cn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

say, I've got a one column table table_a:

col
1

and I have two transactions to update it at the same time:

txn1: txn2:
begin; begin;
update table_a set col= col + 1; update table_a set col = col + 1;
end; end;

if two transaction begin at exact the same time,
what's the result of 'col' after both transactions committed
in Read committed level? it's 3 or 2?
My understanding is the result is 3, because the simultaneous update
would still executed one by one, and the second one would read the
"current" value of 'col' to do the update. But I'm not sure.

thank you!

laser

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-04-01 15:26:56 Re: row-level security model
Previous Message Tom Lane 2004-04-01 15:22:19 Re: Large DB