1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-27 21:43:08 +03:00

Generate GUC tables from .dat file

Store the information in guc_tables.c in a .dat file similar to the
catalog data in src/include/catalog/, and generate a part of
guc_tables.c from that.  The goal is to make it easier to edit that
information, and to be able to make changes to the downstream data
structures more easily.  (Essentially, those are the same reasons as
for the original adoption of the .dat format.)

Reviewed-by: John Naylor <johncnaylorls@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: David E. Wheeler <david@justatheory.com>
Discussion: https://www.postgresql.org/message-id/flat/dae6fe89-1e0c-4c3f-8d92-19d23374fb10%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2025-09-03 09:11:48 +02:00
parent aba8f61c30
commit 6359989654
12 changed files with 3683 additions and 4742 deletions

View File

@@ -1,5 +1,6 @@
/fmgroids.h
/fmgrprotos.h
/guc_tables.inc.c
/probes.h
/errcodes.h
/header-stamp

View File

@@ -254,8 +254,31 @@ extern PGDLLIMPORT bool Debug_pretty_print;
extern PGDLLIMPORT bool Debug_copy_parse_plan_trees;
extern PGDLLIMPORT bool Debug_write_read_parse_plan_trees;
extern PGDLLIMPORT bool Debug_raw_expression_coverage_test;
/*
* support for legacy compile-time settings
*/
#ifdef COPY_PARSE_PLAN_TREES
#define DEFAULT_DEBUG_COPY_PARSE_PLAN_TREES true
#else
#define DEFAULT_DEBUG_COPY_PARSE_PLAN_TREES false
#endif
#ifdef READ_WRITE_PARSE_PLAN_TREES
#define DEFAULT_DEBUG_READ_WRITE_PARSE_PLAN_TREES true
#else
#define DEFAULT_DEBUG_READ_WRITE_PARSE_PLAN_TREES false
#endif
#ifdef RAW_EXPRESSION_COVERAGE_TEST
#define DEFAULT_DEBUG_RAW_EXPRESSION_COVERAGE_TEST true
#else
#define DEFAULT_DEBUG_RAW_EXPRESSION_COVERAGE_TEST false
#endif
#endif /* DEBUG_NODE_TESTS_ENABLED */
extern PGDLLIMPORT bool log_parser_stats;
extern PGDLLIMPORT bool log_planner_stats;
extern PGDLLIMPORT bool log_executor_stats;

View File

@@ -20,6 +20,24 @@
extern PGDLLIMPORT int debug_discard_caches;
#define MIN_DEBUG_DISCARD_CACHES 0
#ifdef DISCARD_CACHES_ENABLED
/* Set default based on older compile-time-only cache clobber macros */
#if defined(CLOBBER_CACHE_RECURSIVELY)
#define DEFAULT_DEBUG_DISCARD_CACHES 3
#elif defined(CLOBBER_CACHE_ALWAYS)
#define DEFAULT_DEBUG_DISCARD_CACHES 1
#else
#define DEFAULT_DEBUG_DISCARD_CACHES 0
#endif
#define MAX_DEBUG_DISCARD_CACHES 5
#else /* not DISCARD_CACHES_ENABLED */
#define DEFAULT_DEBUG_DISCARD_CACHES 0
#define MAX_DEBUG_DISCARD_CACHES 0
#endif /* not DISCARD_CACHES_ENABLED */
typedef void (*SyscacheCallbackFunction) (Datum arg, int cacheid, uint32 hashvalue);
typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid);
typedef void (*RelSyncCallbackFunction) (Datum arg, Oid relid);

View File

@@ -30,6 +30,13 @@ errcodes = custom_target('errcodes',
)
generated_headers += errcodes
guc_tables = custom_target('guc_tables',
input: files('../../backend/utils/misc/guc_parameters.dat'),
output: ['guc_tables.inc.c'],
depend_files: catalog_pm,
command: [perl, files('../../backend/utils/misc/gen_guc_tables.pl'), '@INPUT@', '@OUTPUT@'])
generated_headers += guc_tables
if dtrace.found()
probes_tmp = custom_target('probes.h.tmp',
input: files('../../backend/utils/probes.d'),