Re: GUC values - recommended way to declare the C variables? - Mailing list pgsql-hackers

From Peter Smith
Subject Re: GUC values - recommended way to declare the C variables?
Date
Msg-id CAHut+PtX__sZ8x+kV028rD2+bTHLgskx0hDy=4APJziG79mWBQ@mail.gmail.com
Whole thread Raw
In response to Re: GUC values - recommended way to declare the C variables?  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: GUC values - recommended way to declare the C variables?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Oct 14, 2022 at 8:26 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> On Thu, Oct 13, 2022 at 09:47:25AM +0900, Michael Paquier wrote:
> > So, the initial values of max_wal_senders and max_replication_slots
> > became out of sync with their defaults in guc_tables.c.  FWIW, I would
> > argue the opposite way: rather than removing the initializations, I
> > would fix and keep them as these references can be useful when
> > browsing the area of the code related to such GUCs, without having to
> > look at guc_tables.c for this information.
>
> Well, those initializations are only useful when they are kept in sync,
> which, as demonstrated by this patch, isn't always the case.  I don't have
> a terribly strong opinion about this, but I'd lean towards reducing the
> number of places that track the default value of GUCs.
>

I agree if constants are used in both places then there will always be
some risk they can get out of sync again.

But probably it is no problem to just add #defines (e.g. in
logicallauncher.h?) to be commonly used for the C variable declaration
and also in the guc_tables. I chose not to do that way only because it
didn't seem to be the typical convention for all the other numeric
GUCs I looked at, but it's fine by me if that way is preferred

------
Kind Regards,
Peter Smith.
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant
Next
From: "shiy.fnst@fujitsu.com"
Date:
Subject: RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher