Re: GUC values - recommended way to declare the C variables?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: GUC values - recommended way to declare the C variables?
Date: 2022-10-28 07:05:12
Message-ID: Y1t/KC1hgZLxgwXK@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 28, 2022 at 11:48:13AM +0900, Michael Paquier wrote:
> Thanks. I have not looked at the checkup logic yet, but the central
> declarations seem rather sane, and I have a few comments about the
> latter.

So, I've had the energy to look at the check logic today, and noticed
that, while the proposed patch is doing the job when loading the
in-core GUCs, nothing is happening for the custom GUCs that could be
loaded through shared_preload_libraries or just from a LOAD command.

After adding an extra check in define_custom_variable() (reworking a
bit the interface proposed while on it), I have found a few more
issues than what's been already found on this thread:
- 5 missing spots in pg_stat_statements.
- 3 float rounding issues in pg_trgm.
- 1 spot in pg_prewarm.
- A few more that had no initialization, but these had a default of
false/0/0.0 so it does not influence the end result but I have added
some initializations anyway.

With all that addressed, I am finishing with the attached. I have
added some comments for the default definitions depending on the
CFLAGS, explaining the reasons behind the choices made. The CI has
produced a green run, which is not the same as the buildfarm, still
gives some confidence.

Thoughts?
--
Michael

Attachment Content-Type Size
v7-0001-GUC-C-variable-sanity-check.patch text/x-diff 18.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-10-28 07:07:31 Re: psql: Add command to use extended query protocol
Previous Message Erik Rijkers 2022-10-28 06:54:29 Re: Code checks for App Devs, using new options for transaction behavior