pgsql: Reorganize GUC structs - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Reorganize GUC structs
Date
Msg-id E1vE23w-0043Ps-1j@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Reorganize GUC structs

Instead of having five separate GUC structs, one for each type, with
the generic part contained in each of them, flip it around and have
one common struct, with the type-specific part has a subfield.

The very original GUC design had type-specific structs and
type-specific lists, and the membership in one of the lists defined
the type.  But now the structs themselves know the type (from the
.vartype field), and they are all loaded into a common hash table at
run time, and so this original separation no longer makes sense.  It
creates a bunch of inconsistencies in the code about whether the
type-specific or the generic struct is the primary struct, and a lot
of casting in between, which makes certain assumptions about the
struct layouts.

After the change, all these casts are gone and all the data is
accessed via normal field references.  Also, various code is
simplified because only one kind of struct needs to be processed.

Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://www.postgresql.org/message-id/flat/8fdfb91e-60fb-44fa-8df6-f5dea47353c9@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a13833c35f9e07fe978bf6fad984d6f5f25f59cd

Modified Files
--------------
src/backend/utils/misc/gen_guc_tables.pl |  53 +-
src/backend/utils/misc/guc.c             | 847 ++++++++++++++-----------------
src/backend/utils/misc/guc_funcs.c       |  14 +-
src/backend/utils/misc/help_config.c     |  59 +--
src/include/utils/guc_tables.h           | 180 +++----
src/tools/pgindent/typedefs.list         |   1 -
6 files changed, 525 insertions(+), 629 deletions(-)


pgsql-committers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: pgsql: Add mem_exceeded_count column to pg_stat_replication_slots.
Next
From: Álvaro Herrera
Date:
Subject: pgsql: CheckNNConstraintFetch: Fill all of ConstrCheck in a single pass