Re: Add explicit initialization for all PlannerGlobal fields - Mailing list pgsql-hackers

From David Rowley
Subject Re: Add explicit initialization for all PlannerGlobal fields
Date
Msg-id CAApHDvp3R1CcmZ2WxsvVANZu05104gTPV=biKm+ix-H+-2YmNQ@mail.gmail.com
Whole thread Raw
In response to Add explicit initialization for all PlannerGlobal fields  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: Add explicit initialization for all PlannerGlobal fields
List pgsql-hackers
On Tue, 13 May 2025 at 04:03, Richard Guo <guofenglinux@gmail.com> wrote:
> While adding a new field to PlannerGlobal in another patch, I noticed
> that although most fields are explicitly initialized, a few are not.
> This doesn't cause any functional issues, since makeNode() zeroes all
> fields by default.  However, the inconsistency stood out to me, so I
> wrote the attached patch to explicitly initialize the remaining fields
> for clarity and consistency.
>
> Does this seem worthwhile?  Or should we simply rely on makeNode() for
> zero-initialization and consider this unnecessary?

These should be zeroed explicitly.

David



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Allow reading LSN written by walreciever, but not flushed yet
Next
From: Amit Kapila
Date:
Subject: Re: Add an option to skip loading missing publication to avoid logical replication failure