Search Postgresql Archives

A simple question about Read committed isolation level

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux