Thread: KEY UPDATE / UPDATE / NO KEY UPDATE distinction vs. README.tuplock

KEY UPDATE / UPDATE / NO KEY UPDATE distinction vs. README.tuplock

From
Florian Pflug
Date:
Hi,

It seems that README.tuplock never got updated when the KEY SHARE patch's
lock level were changed from being KEY UPDATE / UPDATE / SHARE / KEY SHARE
to UPDATE / NO KEY UPDATE / SHARE / KEY SHARE.

Thus, as it stands, that file implies that SELECT FOR UPDATE obtains a
weaker lock than an actual UPDATE might take (if that update modifies key
columns) -- according to README.tuplock, the former doesn't conflict with
KEY SHARE while the actual UPDATE would.

But this isn't actually the case in the committed version of the patch -
one now needs to explicitly request that weaker lock level with SELECT FOR
NO KEY UPDATE.

The attached patch updated README.tuplock accordingly.

best regards,
Florian Pflug

Attachment

Re: KEY UPDATE / UPDATE / NO KEY UPDATE distinction vs. README.tuplock

From
Alvaro Herrera
Date:
Florian Pflug wrote:

> It seems that README.tuplock never got updated when the KEY SHARE patch's
> lock level were changed from being KEY UPDATE / UPDATE / SHARE / KEY SHARE
> to UPDATE / NO KEY UPDATE / SHARE / KEY SHARE.

You're right.  We changed the tuple lock modes at the last minute and
I forgot to update this README.  I just pushed it; thanks for the patch
and for improving the wording of that paragraph also.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services