A simple question about Read committed isolation level - Mailing list pgsql-general

From weiping he
Subject A simple question about Read committed isolation level
Date
Msg-id 406C3498.3010703@qmail.zhengmai.net.cn
Whole thread Raw
Responses Re: A simple question about Read committed isolation level
List 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

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: row-level security model
Next
From: Tom Lane
Date:
Subject: Re: 7.2.3-7.4.2 migration