On 28.01.26 13:20, Álvaro Herrera wrote:
> { /* LockTupleKeyShare */
> - AccessShareLock,
> - MultiXactStatusForKeyShare,
> - -1 /* KeyShare does not allow updating tuples */
> + .hwlock = AccessShareLock,
> + .lockstatus = MultiXactStatusForKeyShare,
> + /* KeyShare does not allow updating tuples */
> + .updstatus = -1
> },
You could spruce this up further like
[LockTupleKeyShare] = {
.hwlock = AccessShareLock,
...
},
...
The comments "/* KeyShare does not allow updating tuples */" etc. seem
repetitive and don't actually explain why -1 is an appropriate value.
You could instead write a comment by the declaration of the updstatus
field, like "set to -1 if the tuple lock mode does not allow updating
tuples (see get_mxact_status_for_lock())".