Minor edits to README.tuplock, and a question

Gurjeet Singh <gurjeet@singh.im>

From: "Gurjeet Singh" <gurjeet@singh.im>
To: "PG Hackers" <pgsql-hackers@postgresql.org>
Date: 2025-03-30T06:46:49Z
Lists: pgsql-hackers

Attachments

Please see attached a few minor edits to README.tuplock, which I feel
make an improvement over the current version.

Reading through that, though, I could not see a functional difference
between FOR NO KEY UPDATE and FOR KEY SHARE mode of locks. I understand
they are of different strength, exclusive vs. shared, but the way the
text (quoted below) describes them, they essentially both achieve the
same effect.

> SELECT FOR NO
> KEY UPDATE likewise obtains an exclusive lock, but only prevents tuple removal
> and modifications which might alter the tuple's key.

> SELECT FOR KEY SHARE obtains a shared lock which only
> prevents tuple removal and modifications of key fields.

Am I missing something?

<reads some more of the file>

Nevermind. Deciphering the conflict table below it makes clear the need
for similar looking locks, but with exclusive vs. shared mode
differences. I can't think of an improvement in the two sentences quoted
above, but perhaps others can think of something that helps the reader.

-- 
Best regards,
Gurjeet
http://Gurje.et