GUC tables - use designated initializers

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: GUC tables - use designated initializers
Date: 2022-09-26 23:27:48
Message-ID: CAHut+PtDj3CV+f0pVisc0XYMi2LHGBpQxQWtF0FjiSVN_nV17Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Enums index a number of the GUC tables. This all relies on the
elements being carefully arranged to be in the same order as those
enums. There are comments to say what enum index belongs to each table
element.

But why not use designated initializers to enforce what the comments
are hoping for?

~~

PSA a patch for the same.

Doing this also exposed a minor typo in the comments.
"ERROR_HANDLING" -> "ERROR_HANDLING_OPTIONS"

Furthermore, with this change, now the GUC table elements are able to
be rearranged into any different order - eg alphabetical - if that
would be useful (my patch does not do this).

~~

In passing, I also made a 0002 patch to remove some inconsistent
whitespace noticed in those config tables.

Thoughts?

------
Kind Regards,
Peter Smith.
Fujitsu Australia.

Attachment Content-Type Size
v1-0001-GUC-tables-used-designated-initializers.patch application/octet-stream 7.5 KB
v1-0002-GUC-tables-remove-unnecessary-whitespace.patch application/octet-stream 63.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2022-09-26 23:51:12 GUC values - recommended way to declare the C variables?
Previous Message Ibrar Ahmed 2022-09-26 23:26:53 [Commitfest 2022-09] Last days