Re: Reorganize GUC structs

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, Heikki Linnakangas <hlinnaka@iki.fi>, Álvaro Herrera <alvherre@kurilemu.de>, John Naylor <johncnaylorls@gmail.com>
Date: 2025-11-07T15:14:55Z
Lists: pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes:
> Here are a few more small patches to fix related things I found 
> afterwards or in passing.

Looks sane, except that the comparator could do with an extra "const"
if there's enough room on the line:

+    const struct config_generic *ca = *(const struct config_generic *const *) a;
+    const struct config_generic *cb = *(const struct config_generic *const *) b;

Not essential, but casting const away even transiently looks ugly.

			regards, tom lane



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