Search Postgresql Archives

Re: A simple question about Read committed isolation level

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

 



weiping he <laser@qmail.zhengmai.net.cn> writes:
> 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,

If the second xact to lock the row is READ COMMITTED, you get 3.
If it's SERIALIZABLE you get an error.  In no case will you silently
lose an update.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[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