Re: GUC values - recommended way to declare the C variables?
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Peter Smith <smithpb2250@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Tom Lane <tgl@sss.pgh.pa.us>, Nathan Bossart <nathandbossart@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2022-10-28T07:05:12Z
Lists: pgsql-hackers
Attachments
- v7-0001-GUC-C-variable-sanity-check.patch (text/x-diff) patch v7-0001
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
Commits
-
Add check on initial and boot values when loading GUCs
- a73952b79563 16.0 landed
-
Clean up some inconsistencies with GUC declarations
- d9d873bac670 16.0 landed
-
Clean up some GUC declarations and comments
- 7d25958453a6 16.0 landed