Re: trivial designated initializers - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: trivial designated initializers
Date
Msg-id 202601300912.ccxqnxxcl72r@alvherre.pgsql
Whole thread Raw
In response to Re: trivial designated initializers  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
On 2026-Jan-29, Peter Eisentraut wrote:

> You could spruce this up further like
> 
> [LockTupleKeyShare] = {
>     .hwlock = AccessShareLock,
>     ...
> },

Oh right, done that way.

> 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())".

Good point. I rewrote the comment on top of the declaration and pushed,
thanks for the reviews.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Hay dos momentos en la vida de un hombre en los que no debería
especular: cuando puede permitírselo y cuando no puede" (Mark Twain)



pgsql-hackers by date:

Previous
From: Kirill Reshke
Date:
Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Next
From: Alexandre Felipe
Date:
Subject: [PATCH] btree merge scan proposal