Re: gen_guc_tables.pl: Validate required GUC fields before code generation - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: gen_guc_tables.pl: Validate required GUC fields before code generation
Date
Msg-id a6381f56-c8d2-4121-8438-0479aa891419@eisentraut.org
Whole thread Raw
In response to Re: gen_guc_tables.pl: Validate required GUC fields before code generation  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: gen_guc_tables.pl: Validate required GUC fields before code generation
List pgsql-hackers
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.



pgsql-hackers by date:

Previous
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Newly created replication slot may be invalidated by checkpoint
Next
From: Peter Eisentraut
Date:
Subject: Re: PRI?64 vs Visual Studio (2022)