aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-09-13 11:05:07 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-09-13 11:11:45 -0400
commit0a20ff54f5e66158930d5328f89f087d4e9ab400 (patch)
tree061094ad7638e0d0be3fe007f29ed31710a75cec /src/include
parent257eb57b50f7c65467bfc2f4d579622fa13f3370 (diff)
downloadpostgresql-0a20ff54f5e66158930d5328f89f087d4e9ab400.tar.gz
postgresql-0a20ff54f5e66158930d5328f89f087d4e9ab400.zip
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it a bottleneck for compilation. It's also acquired a bunch of knowledge that'd be better kept elsewhere, because of our not very good habit of putting variable-specific check hooks here. Hence, split it up along these lines: * guc.c itself retains just the core GUC housekeeping mechanisms. * New file guc_funcs.c contains the SET/SHOW interfaces and some SQL-accessible functions for GUC manipulation. * New file guc_tables.c contains the data arrays that define the built-in GUC variables, along with some already-exported constant tables. * GUC check/assign/show hook functions are moved to the variable's home module, whenever that's clearly identifiable. A few hard- to-classify hooks ended up in commands/variable.c, which was already a home for miscellaneous GUC hook functions. To avoid cluttering a lot more header files with #include "guc.h", I also invented a new header file utils/guc_hooks.h and put all the GUC hook functions' declarations there, regardless of their originating module. That allowed removal of #include "guc.h" from some existing headers. The fallout from that (hopefully all caught here) demonstrates clearly why such inclusions are best minimized: there are a lot of files that, for example, were getting array.h at two or more levels of remove, despite not having any connection at all to GUCs in themselves. There is some very minor code beautification here, such as renaming a couple of inconsistently-named hook functions and improving some comments. But mostly this just moves code from point A to point B and deals with the ensuing needs for #include adjustments and exporting a few functions that previously weren't exported. Patch by me, per a suggestion from Andres Freund; thanks also to Michael Paquier for the idea to invent guc_funcs.c. Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/tableam.h4
-rw-r--r--src/include/access/xlog.h4
-rw-r--r--src/include/commands/variable.h38
-rw-r--r--src/include/replication/syncrep.h6
-rw-r--r--src/include/tcop/tcopprot.h3
-rw-r--r--src/include/tsearch/ts_cache.h4
-rw-r--r--src/include/utils/elog.h4
-rw-r--r--src/include/utils/guc.h50
-rw-r--r--src/include/utils/guc_hooks.h158
-rw-r--r--src/include/utils/guc_tables.h22
-rw-r--r--src/include/utils/pg_locale.h11
11 files changed, 196 insertions, 108 deletions
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index 9df4e7cb0ab..ffe265d2a15 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -20,7 +20,7 @@
#include "access/relscan.h"
#include "access/sdir.h"
#include "access/xact.h"
-#include "utils/guc.h"
+#include "executor/tuptable.h"
#include "utils/rel.h"
#include "utils/snapshot.h"
@@ -2072,7 +2072,5 @@ extern void table_block_relation_estimate_size(Relation rel,
extern const TableAmRoutine *GetTableAmRoutine(Oid amhandler);
extern const TableAmRoutine *GetHeapamTableAmRoutine(void);
-extern bool check_default_table_access_method(char **newval, void **extra,
- GucSource source);
#endif /* TABLEAM_H */
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index cd674c3c23f..9ebd321ba76 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -227,6 +227,7 @@ extern XLogRecPtr GetFakeLSNForUnloggedRel(void);
extern Size XLOGShmemSize(void);
extern void XLOGShmemInit(void);
extern void BootStrapXLOG(void);
+extern void InitializeWalConsistencyChecking(void);
extern void LocalProcessControlFile(bool reset);
extern void StartupXLOG(void);
extern void ShutdownXLOG(int code, Datum arg);
@@ -245,9 +246,6 @@ extern XLogRecPtr GetLastImportantRecPtr(void);
extern void SetWalWriterSleeping(bool sleeping);
-extern void assign_max_wal_size(int newval, void *extra);
-extern void assign_checkpoint_completion_target(double newval, void *extra);
-
/*
* Routines used by xlogrecovery.c to call back into xlog.c during recovery.
*/
diff --git a/src/include/commands/variable.h b/src/include/commands/variable.h
deleted file mode 100644
index 0e5ddcbcf37..00000000000
--- a/src/include/commands/variable.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * variable.h
- * Routines for handling specialized SET variables.
- *
- * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * src/include/commands/variable.h
- */
-#ifndef VARIABLE_H
-#define VARIABLE_H
-
-#include "utils/guc.h"
-
-
-extern bool check_datestyle(char **newval, void **extra, GucSource source);
-extern void assign_datestyle(const char *newval, void *extra);
-extern bool check_timezone(char **newval, void **extra, GucSource source);
-extern void assign_timezone(const char *newval, void *extra);
-extern const char *show_timezone(void);
-extern bool check_log_timezone(char **newval, void **extra, GucSource source);
-extern void assign_log_timezone(const char *newval, void *extra);
-extern const char *show_log_timezone(void);
-extern bool check_transaction_read_only(bool *newval, void **extra, GucSource source);
-extern bool check_XactIsoLevel(int *newval, void **extra, GucSource source);
-extern bool check_transaction_deferrable(bool *newval, void **extra, GucSource source);
-extern bool check_random_seed(double *newval, void **extra, GucSource source);
-extern void assign_random_seed(double newval, void *extra);
-extern const char *show_random_seed(void);
-extern bool check_client_encoding(char **newval, void **extra, GucSource source);
-extern void assign_client_encoding(const char *newval, void *extra);
-extern bool check_session_authorization(char **newval, void **extra, GucSource source);
-extern void assign_session_authorization(const char *newval, void *extra);
-extern bool check_role(char **newval, void **extra, GucSource source);
-extern void assign_role(const char *newval, void *extra);
-extern const char *show_role(void);
-
-#endif /* VARIABLE_H */
diff --git a/src/include/replication/syncrep.h b/src/include/replication/syncrep.h
index 4d7c90b9f0d..b5446597b50 100644
--- a/src/include/replication/syncrep.h
+++ b/src/include/replication/syncrep.h
@@ -14,7 +14,6 @@
#define _SYNCREP_H
#include "access/xlogdefs.h"
-#include "utils/guc.h"
#define SyncRepRequested() \
(max_wal_senders > 0 && synchronous_commit > SYNCHRONOUS_COMMIT_LOCAL_FLUSH)
@@ -97,11 +96,6 @@ extern int SyncRepGetCandidateStandbys(SyncRepStandbyData **standbys);
/* called by checkpointer */
extern void SyncRepUpdateSyncStandbysDefined(void);
-/* GUC infrastructure */
-extern bool check_synchronous_standby_names(char **newval, void **extra, GucSource source);
-extern void assign_synchronous_standby_names(const char *newval, void *extra);
-extern void assign_synchronous_commit(int newval, void *extra);
-
/*
* Internal functions for parsing synchronous_standby_names grammar,
* in syncrep_gram.y and syncrep_scanner.l
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
index 70d9dab25b8..5d34978f329 100644
--- a/src/include/tcop/tcopprot.h
+++ b/src/include/tcop/tcopprot.h
@@ -66,9 +66,6 @@ extern List *pg_plan_queries(List *querytrees, const char *query_string,
int cursorOptions,
ParamListInfo boundParams);
-extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
-extern void assign_max_stack_depth(int newval, void *extra);
-
extern void die(SIGNAL_ARGS);
extern void quickdie(SIGNAL_ARGS) pg_attribute_noreturn();
extern void StatementCancelHandler(SIGNAL_ARGS);
diff --git a/src/include/tsearch/ts_cache.h b/src/include/tsearch/ts_cache.h
index 5e4a49ea1c7..bcb5c7665ba 100644
--- a/src/include/tsearch/ts_cache.h
+++ b/src/include/tsearch/ts_cache.h
@@ -13,7 +13,7 @@
#ifndef TS_CACHE_H
#define TS_CACHE_H
-#include "utils/guc.h"
+#include "fmgr.h"
/*
@@ -92,7 +92,5 @@ extern TSDictionaryCacheEntry *lookup_ts_dictionary_cache(Oid dictId);
extern TSConfigCacheEntry *lookup_ts_config_cache(Oid cfgId);
extern Oid getTSCurrentConfig(bool emitError);
-extern bool check_TSCurrentConfig(char **newval, void **extra, GucSource source);
-extern void assign_TSCurrentConfig(const char *newval, void *extra);
#endif /* TS_CACHE_H */
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index 56398176901..4dd9658a3cf 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -460,10 +460,6 @@ extern void write_pipe_chunks(char *data, int len, int dest);
extern void write_csvlog(ErrorData *edata);
extern void write_jsonlog(ErrorData *edata);
-#ifdef HAVE_SYSLOG
-extern void set_syslog_parameters(const char *ident, int facility);
-#endif
-
/*
* Write errors to stderr (or by equal means when stderr is
* not available). Used before ereport/elog can be used
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 5da17a48495..e426dd757d9 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -1,8 +1,7 @@
/*--------------------------------------------------------------------
* guc.h
*
- * External declarations pertaining to backend/utils/misc/guc.c and
- * backend/utils/misc/guc-file.l
+ * External declarations pertaining to Grand Unified Configuration.
*
* Copyright (c) 2000-2022, PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
@@ -242,7 +241,7 @@ typedef enum
#define GUC_UNIT (GUC_UNIT_MEMORY | GUC_UNIT_TIME)
-/* GUC vars that are actually declared in guc.c, rather than elsewhere */
+/* GUC vars that are actually defined in guc_tables.c, rather than elsewhere */
extern PGDLLIMPORT bool Debug_print_plan;
extern PGDLLIMPORT bool Debug_print_parse;
extern PGDLLIMPORT bool Debug_print_rewritten;
@@ -269,7 +268,6 @@ extern PGDLLIMPORT int log_temp_files;
extern PGDLLIMPORT double log_statement_sample_rate;
extern PGDLLIMPORT double log_xact_sample_rate;
extern PGDLLIMPORT char *backtrace_functions;
-extern PGDLLIMPORT char *backtrace_symbol_list;
extern PGDLLIMPORT int temp_file_limit;
@@ -371,7 +369,6 @@ extern void ProcessConfigFile(GucContext context);
extern char *convert_GUC_name_for_parameter_acl(const char *name);
extern bool check_GUC_name_for_parameter_acl(const char *name);
extern void InitializeGUCOptions(void);
-extern void InitializeWalConsistencyChecking(void);
extern bool SelectConfigFiles(const char *userDoption, const char *progname);
extern void ResetAllOptions(void);
extern void AtStart_GUC(void);
@@ -380,6 +377,7 @@ extern void AtEOXact_GUC(bool isCommit, int nestLevel);
extern void BeginReportingGUCOptions(void);
extern void ReportChangedGUCOptions(void);
extern void ParseLongOption(const char *string, char **name, char **value);
+extern const char *get_config_unit_name(int flags);
extern bool parse_int(const char *value, int *result, int flags,
const char **hintmsg);
extern bool parse_real(const char *value, double *result, int flags,
@@ -396,22 +394,18 @@ extern int set_config_option_ext(const char *name, const char *value,
extern void AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt);
extern char *GetConfigOptionByName(const char *name, const char **varname,
bool missing_ok);
-extern void GetConfigOptionByNum(int varnum, const char **values, bool *noshow);
extern int GetNumConfigOptions(void);
-extern void SetPGVariable(const char *name, List *args, bool is_local);
-extern void GetPGVariable(const char *name, DestReceiver *dest);
-extern TupleDesc GetPGVariableResultDesc(const char *name);
-
-extern void ExecSetVariableStmt(VariableSetStmt *stmt, bool isTopLevel);
-extern char *ExtractSetVariableArgs(VariableSetStmt *stmt);
-
extern void ProcessGUCArray(ArrayType *array,
GucContext context, GucSource source, GucAction action);
extern ArrayType *GUCArrayAdd(ArrayType *array, const char *name, const char *value);
extern ArrayType *GUCArrayDelete(ArrayType *array, const char *name);
extern ArrayType *GUCArrayReset(ArrayType *array);
+extern void *guc_malloc(int elevel, size_t size);
+extern pg_nodiscard void *guc_realloc(int elevel, void *old, size_t size);
+extern char *guc_strdup(int elevel, const char *src);
+
#ifdef EXEC_BACKEND
extern void write_nondefault_variables(GucContext context);
extern void read_nondefault_variables(void);
@@ -422,6 +416,13 @@ extern Size EstimateGUCStateSpace(void);
extern void SerializeGUCState(Size maxsize, char *start_address);
extern void RestoreGUCState(void *gucstate);
+/* Functions exported by guc_funcs.c */
+extern void ExecSetVariableStmt(VariableSetStmt *stmt, bool isTopLevel);
+extern char *ExtractSetVariableArgs(VariableSetStmt *stmt);
+extern void SetPGVariable(const char *name, List *args, bool is_local);
+extern void GetPGVariable(const char *name, DestReceiver *dest);
+extern TupleDesc GetPGVariableResultDesc(const char *name);
+
/* Support for messages reported from GUC check hooks */
extern PGDLLIMPORT char *GUC_check_errmsg_string;
@@ -442,27 +443,4 @@ extern void GUC_check_errcode(int sqlerrcode);
pre_format_elog_string(errno, TEXTDOMAIN), \
GUC_check_errhint_string = format_elog_string
-/*
- * The following functions are not in guc.c, but are declared here to avoid
- * having to include guc.h in some widely used headers that it really doesn't
- * belong in.
- */
-
-/* in commands/tablespace.c */
-extern bool check_default_tablespace(char **newval, void **extra, GucSource source);
-extern bool check_temp_tablespaces(char **newval, void **extra, GucSource source);
-extern void assign_temp_tablespaces(const char *newval, void *extra);
-
-/* in catalog/namespace.c */
-extern bool check_search_path(char **newval, void **extra, GucSource source);
-extern void assign_search_path(const char *newval, void *extra);
-
-/* in access/transam/xlog.c */
-extern bool check_wal_buffers(int *newval, void **extra, GucSource source);
-extern void assign_xlog_sync_method(int new_sync_method, void *extra);
-
-/* in access/transam/xlogprefetcher.c */
-extern bool check_recovery_prefetch(int *new_value, void **extra, GucSource source);
-extern void assign_recovery_prefetch(int new_value, void *extra);
-
#endif /* GUC_H */
diff --git a/src/include/utils/guc_hooks.h b/src/include/utils/guc_hooks.h
new file mode 100644
index 00000000000..f1a9a183b49
--- /dev/null
+++ b/src/include/utils/guc_hooks.h
@@ -0,0 +1,158 @@
+/*-------------------------------------------------------------------------
+ *
+ * guc_hooks.h
+ * Declarations of per-variable callback functions used by GUC.
+ *
+ * These functions are scattered throughout the system, but we
+ * declare them all here to avoid having to propagate guc.h into
+ * a lot of unrelated header files.
+ *
+ * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
+ *
+ * src/include/utils/guc_hooks.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef GUC_HOOKS_H
+#define GUC_HOOKS_H 1
+
+#include "utils/guc.h"
+
+/*
+ * See guc.h for the typedefs that these hook functions should match
+ * (GucBoolCheckHook and so on).
+ *
+ * Please keep the declarations in order by GUC variable name.
+ */
+
+extern bool check_application_name(char **newval, void **extra,
+ GucSource source);
+extern void assign_application_name(const char *newval, void *extra);
+extern const char *show_archive_command(void);
+extern bool check_autovacuum_max_workers(int *newval, void **extra,
+ GucSource source);
+extern bool check_autovacuum_work_mem(int *newval, void **extra,
+ GucSource source);
+extern bool check_backtrace_functions(char **newval, void **extra,
+ GucSource source);
+extern void assign_backtrace_functions(const char *newval, void *extra);
+extern bool check_bonjour(bool *newval, void **extra, GucSource source);
+extern bool check_canonical_path(char **newval, void **extra, GucSource source);
+extern void assign_checkpoint_completion_target(double newval, void *extra);
+extern bool check_client_connection_check_interval(int *newval, void **extra,
+ GucSource source);
+extern bool check_client_encoding(char **newval, void **extra, GucSource source);
+extern void assign_client_encoding(const char *newval, void *extra);
+extern bool check_cluster_name(char **newval, void **extra, GucSource source);
+extern const char *show_data_directory_mode(void);
+extern bool check_datestyle(char **newval, void **extra, GucSource source);
+extern void assign_datestyle(const char *newval, void *extra);
+extern bool check_default_table_access_method(char **newval, void **extra,
+ GucSource source);
+extern bool check_default_tablespace(char **newval, void **extra,
+ GucSource source);
+extern bool check_default_text_search_config(char **newval, void **extra, GucSource source);
+extern void assign_default_text_search_config(const char *newval, void *extra);
+extern bool check_default_with_oids(bool *newval, void **extra,
+ GucSource source);
+extern bool check_effective_io_concurrency(int *newval, void **extra,
+ GucSource source);
+extern bool check_huge_page_size(int *newval, void **extra, GucSource source);
+extern const char *show_in_hot_standby(void);
+extern bool check_locale_messages(char **newval, void **extra, GucSource source);
+extern void assign_locale_messages(const char *newval, void *extra);
+extern bool check_locale_monetary(char **newval, void **extra, GucSource source);
+extern void assign_locale_monetary(const char *newval, void *extra);
+extern bool check_locale_numeric(char **newval, void **extra, GucSource source);
+extern void assign_locale_numeric(const char *newval, void *extra);
+extern bool check_locale_time(char **newval, void **extra, GucSource source);
+extern void assign_locale_time(const char *newval, void *extra);
+extern bool check_log_destination(char **newval, void **extra,
+ GucSource source);
+extern void assign_log_destination(const char *newval, void *extra);
+extern const char *show_log_file_mode(void);
+extern bool check_log_stats(bool *newval, void **extra, GucSource source);
+extern bool check_log_timezone(char **newval, void **extra, GucSource source);
+extern void assign_log_timezone(const char *newval, void *extra);
+extern const char *show_log_timezone(void);
+extern bool check_maintenance_io_concurrency(int *newval, void **extra,
+ GucSource source);
+extern void assign_maintenance_io_concurrency(int newval, void *extra);
+extern bool check_max_connections(int *newval, void **extra, GucSource source);
+extern bool check_max_wal_senders(int *newval, void **extra, GucSource source);
+extern void assign_max_wal_size(int newval, void *extra);
+extern bool check_max_worker_processes(int *newval, void **extra,
+ GucSource source);
+extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
+extern void assign_max_stack_depth(int newval, void *extra);
+extern bool check_primary_slot_name(char **newval, void **extra,
+ GucSource source);
+extern bool check_random_seed(double *newval, void **extra, GucSource source);
+extern void assign_random_seed(double newval, void *extra);
+extern const char *show_random_seed(void);
+extern bool check_recovery_prefetch(int *new_value, void **extra,
+ GucSource source);
+extern void assign_recovery_prefetch(int new_value, void *extra);
+extern bool check_recovery_target(char **newval, void **extra,
+ GucSource source);
+extern void assign_recovery_target(const char *newval, void *extra);
+extern bool check_recovery_target_lsn(char **newval, void **extra,
+ GucSource source);
+extern void assign_recovery_target_lsn(const char *newval, void *extra);
+extern bool check_recovery_target_name(char **newval, void **extra,
+ GucSource source);
+extern void assign_recovery_target_name(const char *newval, void *extra);
+extern bool check_recovery_target_time(char **newval, void **extra,
+ GucSource source);
+extern void assign_recovery_target_time(const char *newval, void *extra);
+extern bool check_recovery_target_timeline(char **newval, void **extra,
+ GucSource source);
+extern void assign_recovery_target_timeline(const char *newval, void *extra);
+extern bool check_recovery_target_xid(char **newval, void **extra,
+ GucSource source);
+extern void assign_recovery_target_xid(const char *newval, void *extra);
+extern bool check_role(char **newval, void **extra, GucSource source);
+extern void assign_role(const char *newval, void *extra);
+extern const char *show_role(void);
+extern bool check_search_path(char **newval, void **extra, GucSource source);
+extern void assign_search_path(const char *newval, void *extra);
+extern bool check_session_authorization(char **newval, void **extra, GucSource source);
+extern void assign_session_authorization(const char *newval, void *extra);
+extern void assign_session_replication_role(int newval, void *extra);
+extern bool check_ssl(bool *newval, void **extra, GucSource source);
+extern bool check_stage_log_stats(bool *newval, void **extra, GucSource source);
+extern bool check_synchronous_standby_names(char **newval, void **extra,
+ GucSource source);
+extern void assign_synchronous_standby_names(const char *newval, void *extra);
+extern void assign_synchronous_commit(int newval, void *extra);
+extern void assign_syslog_facility(int newval, void *extra);
+extern void assign_syslog_ident(const char *newval, void *extra);
+extern void assign_tcp_keepalives_count(int newval, void *extra);
+extern const char *show_tcp_keepalives_count(void);
+extern void assign_tcp_keepalives_idle(int newval, void *extra);
+extern const char *show_tcp_keepalives_idle(void);
+extern void assign_tcp_keepalives_interval(int newval, void *extra);
+extern const char *show_tcp_keepalives_interval(void);
+extern void assign_tcp_user_timeout(int newval, void *extra);
+extern const char *show_tcp_user_timeout(void);
+extern bool check_temp_buffers(int *newval, void **extra, GucSource source);
+extern bool check_temp_tablespaces(char **newval, void **extra,
+ GucSource source);
+extern void assign_temp_tablespaces(const char *newval, void *extra);
+extern bool check_timezone(char **newval, void **extra, GucSource source);
+extern void assign_timezone(const char *newval, void *extra);
+extern const char *show_timezone(void);
+extern bool check_timezone_abbreviations(char **newval, void **extra,
+ GucSource source);
+extern void assign_timezone_abbreviations(const char *newval, void *extra);
+extern bool check_transaction_deferrable(bool *newval, void **extra, GucSource source);
+extern bool check_transaction_isolation(int *newval, void **extra, GucSource source);
+extern bool check_transaction_read_only(bool *newval, void **extra, GucSource source);
+extern const char *show_unix_socket_permissions(void);
+extern bool check_wal_buffers(int *newval, void **extra, GucSource source);
+extern bool check_wal_consistency_checking(char **newval, void **extra,
+ GucSource source);
+extern void assign_wal_consistency_checking(const char *newval, void *extra);
+extern void assign_xlog_sync_method(int new_sync_method, void *extra);
+
+#endif /* GUC_HOOKS_H */
diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h
index 90565b99212..b3d2a959c3a 100644
--- a/src/include/utils/guc_tables.h
+++ b/src/include/utils/guc_tables.h
@@ -263,6 +263,23 @@ extern PGDLLIMPORT const char *const config_type_names[];
extern PGDLLIMPORT const char *const GucContext_Names[];
extern PGDLLIMPORT const char *const GucSource_Names[];
+/* data arrays defining all the built-in GUC variables */
+extern PGDLLIMPORT struct config_bool ConfigureNamesBool[];
+extern PGDLLIMPORT struct config_int ConfigureNamesInt[];
+extern PGDLLIMPORT struct config_real ConfigureNamesReal[];
+extern PGDLLIMPORT struct config_string ConfigureNamesString[];
+extern PGDLLIMPORT struct config_enum ConfigureNamesEnum[];
+
+/* lookup GUC variables, returning config_generic pointers */
+extern struct config_generic *find_option(const char *name,
+ bool create_placeholders,
+ bool skip_errors,
+ int elevel);
+extern struct config_generic **get_explain_guc_options(int *num);
+
+/* get string value of variable */
+extern char *ShowGUCOption(struct config_generic *record, bool use_units);
+
/* get the current set of variables */
extern struct config_generic **get_guc_variables(void);
@@ -272,6 +289,9 @@ extern void build_guc_variables(void);
extern const char *config_enum_lookup_by_value(struct config_enum *record, int val);
extern bool config_enum_lookup_by_name(struct config_enum *record,
const char *value, int *retval);
-extern struct config_generic **get_explain_guc_options(int *num);
+extern char *config_enum_get_options(struct config_enum *record,
+ const char *prefix,
+ const char *suffix,
+ const char *separator);
#endif /* GUC_TABLES_H */
diff --git a/src/include/utils/pg_locale.h b/src/include/utils/pg_locale.h
index e7385faef86..a8759421236 100644
--- a/src/include/utils/pg_locale.h
+++ b/src/include/utils/pg_locale.h
@@ -19,8 +19,6 @@
#include <unicode/ucol.h>
#endif
-#include "utils/guc.h"
-
#ifdef USE_ICU
/*
* ucol_strcollUTF8() was introduced in ICU 50, but it is buggy before ICU 53.
@@ -50,15 +48,6 @@ extern PGDLLIMPORT char *localized_abbrev_months[];
extern PGDLLIMPORT char *localized_full_months[];
-extern bool check_locale_messages(char **newval, void **extra, GucSource source);
-extern void assign_locale_messages(const char *newval, void *extra);
-extern bool check_locale_monetary(char **newval, void **extra, GucSource source);
-extern void assign_locale_monetary(const char *newval, void *extra);
-extern bool check_locale_numeric(char **newval, void **extra, GucSource source);
-extern void assign_locale_numeric(const char *newval, void *extra);
-extern bool check_locale_time(char **newval, void **extra, GucSource source);
-extern void assign_locale_time(const char *newval, void *extra);
-
extern bool check_locale(int category, const char *locale, char **canonname);
extern char *pg_perm_setlocale(int category, const char *locale);
extern void check_strxfrm_bug(void);