Re: trivial designated initializers

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: trivial designated initializers
Date: 2026-01-30 09:28:02
Message-ID: 202601300912.ccxqnxxcl72r@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexandre Felipe 2026-01-30 09:32:14 [PATCH] btree merge scan proposal
Previous Message Kirill Reshke 2026-01-30 09:25:17 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)