Re: gen_guc_tables.pl: Validate required GUC fields before code generation
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Chao Li <li.evan.chao@gmail.com>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-19T08:33:46Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
gen_guc_tables.pl: Validate required GUC fields before code generation
- 7169c0b96bb8 19 (unreleased) landed
I find the data structures that you have constructed here barely
understandable:
my %required_by_type = (
int => [qw(min max)],
real => [qw(min max)],
enum => [qw(options)],
);
for my $f (@required_common, @{ $required_by_type{$entry->{type} //
''} // [] }) {
[qw(min max)] is an array inside an array reference? I think? Do we
need two levels of nesting?
I think this // notation is unnecessarily confusing, and why do we need
two of them. I thought your first patch
+ bool => [], # no extra required fields
+ string => [], # no extra required fields
was clearer. And that way, we also check that the field type is one of
the ones we support.