pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: gen_guc_tables.pl: Validate required GUC fields before code gene
Date: Tue, 25 Nov 2025 15:59:19 +0000
Message-ID: <E1vNvRm-001Mcu-2c@gemulon.postgresql.org> (raw)

gen_guc_tables.pl: Validate required GUC fields before code generation

Previously, gen_guc_tables.pl would emit "Use of uninitialized value"
warnings if required fields were missing in guc_parameters.dat (for
example, when an integer or real GUC omitted the 'max' value).  The
resulting error messages were unclear and did not identify which GUC
entry was problematic.

Add explicit validation of required fields depending on the parameter
type, and fail with a clear and specific message such as:

    guc_parameters.dat:1909: error: entry "max_index_keys" of type "int" is missing required field "max"

No changes to generated guc_tables.c.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/CAEoWx2%3DoP4LgHi771_OKhPPUS7B-CTqCs%3D%3DuQcNXWrwBoAm5Vg...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7169c0b96bb8929c939c8e96a52b42571085efe9

Modified Files
--------------
src/backend/utils/misc/gen_guc_tables.pl | 48 ++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)



Message-ID: <E1vNvRm-001Mcu-2c@gemulon.postgresql.org>
Permalink:  ../E1vNvRm-001Mcu-2c@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vNvRm-001Mcu-2c@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: gen_guc_tables.pl: Validate required GUC fields before code gene
  In-Reply-To: <E1vNvRm-001Mcu-2c@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox