Hello,
I think in Postgresql, concurrency control acts like this:
tuple's infomask shows if it is being updated. If it is being updated now,
the latter transaction should reread the tuple and get the newer tuple.
During the progress of getting the newer tuple, it must use transaction
lock, I mean XactLockTableWait(...).
From the above, I think the tuple lock is unnecessary, because it uses
transaction lock.
Besides, tuple lock is unlocked after the tuple is updated but not after the
transaction commits. I mean it's not 2PL.
So, may you tell me why there is tuple lock in Postgresql ? Is the tuple
lock necessary?
Thanks,
--Huang Xiaocheng
--Database & Information System Lab, Nankai University