Re: Reorganize GUC structs

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Heikki Linnakangas <hlinnaka@iki.fi>, Álvaro Herrera <alvherre@kurilemu.de>, John Naylor <johncnaylorls@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-11-03T11:16:13Z
Lists: pgsql-hackers
On 29.10.25 10:07, Peter Eisentraut wrote:
> On 24.10.25 14:21, Heikki Linnakangas wrote:
>>> @@ -261,15 +261,15 @@ static bool 
>>> assignable_custom_variable_name(const char *name, bool skip_errors,
>>>                                              int elevel);
>>>  static void do_serialize(char **destptr, Size *maxbytes,
>>>                           const char *fmt,...) pg_attribute_printf(3, 
>>> 4);
>>> -static bool call_bool_check_hook(const struct config_bool *conf, 
>>> bool *newval,
>>> +static bool call_bool_check_hook(const struct config_generic *conf, 
>>> bool *newval,
>>>                                   void **extra, GucSource source, int 
>>> elevel);
>>> -static bool call_int_check_hook(const struct config_int *conf, int 
>>> *newval,
>>> +static bool call_int_check_hook(const struct config_generic *conf, 
>>> int *newval,
>>>                                  void **extra, GucSource source, int 
>>> elevel);
>>> -static bool call_real_check_hook(const struct config_real *conf, 
>>> double *newval,
>>> +static bool call_real_check_hook(const struct config_generic *conf, 
>>> double *newval,
>>>                                   void **extra, GucSource source, int 
>>> elevel);
>>> -static bool call_string_check_hook(const struct config_string *conf, 
>>> char **newval,
>>> +static bool call_string_check_hook(const struct config_generic 
>>> *conf, char **newval,
>>>                                     void **extra, GucSource source, 
>>> int elevel);
>>> -static bool call_enum_check_hook(const struct config_enum *conf, int 
>>> *newval,
>>> +static bool call_enum_check_hook(const struct config_generic *conf, 
>>> int *newval,
>>>                                   void **extra, GucSource source, int 
>>> elevel);
>>
>> The new signatures for these function are less specific than before, 
>> making them a little worse IMO. Overall +1 on the patches, despite 
>> that little drawback.
> 
> Thanks, pushed.

The remaining patches to sort the list alphabetically have also been pushed.




Commits

  1. Remove extraneous newlines from guc_parameters.dat

  2. Fix NLS for incorrect GUC enum value hint message

  3. Clean up qsort comparison function for GUC entries

  4. Sort guc_parameters.dat alphabetically by name

  5. Reorganize GUC structs

  6. Change config_generic.vartype to be initialized at compile time

  7. Use designated initializers for guc_tables

  8. Change reset_extra into a config_generic common field

  9. Add some const qualifiers

  10. Modernize some for loops