From 532fac469e1d5dc8737533c8ffb5a155c6371924 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Fri, 24 Feb 2023 14:03:21 +0100 Subject: [PATCH] Fix outdated references to guc.c Commit 0a20ff54f split out the GUC variables from guc.c into a new file guc_tables.c. This updates comments referencing guc.c regarding variables which are now in guc_tables.c --- src/backend/access/transam/varsup.c | 4 ++-- src/backend/commands/variable.c | 2 +- src/backend/libpq/be-secure-openssl.c | 2 +- src/backend/storage/ipc/procarray.c | 4 ++-- src/backend/storage/lmgr/predicate.c | 6 +++--- src/backend/utils/adt/ruleutils.c | 2 +- src/backend/utils/sort/tuplesort.c | 4 ++-- src/backend/utils/sort/tuplestore.c | 4 ++-- src/bin/pg_dump/dumputils.c | 9 +++++---- src/include/miscadmin.h | 2 +- src/test/modules/test_misc/t/003_check_guc.pl | 8 ++++---- src/timezone/pgtz.c | 2 +- 12 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c index 334adac09e..a0be3efffe 100644 --- a/src/backend/access/transam/varsup.c +++ b/src/backend/access/transam/varsup.c @@ -397,8 +397,8 @@ SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid) * We'll start trying to force autovacuums when oldest_datfrozenxid gets * to be more than autovacuum_freeze_max_age transactions old. * - * Note: guc.c ensures that autovacuum_freeze_max_age is in a sane range, - * so that xidVacLimit will be well before xidWarnLimit. + * Note: guc_tables.c ensures that autovacuum_freeze_max_age is in a sane + * range, so that xidVacLimit will be well before xidWarnLimit. * * Note: autovacuum_freeze_max_age is a PGC_POSTMASTER parameter so that * we don't have to worry about dealing with on-the-fly changes in its diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index bb0f5de4c2..f0f2e07655 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -877,7 +877,7 @@ assign_session_authorization(const char *newval, void *extra) * a translation of "none" to InvalidOid. Otherwise this is much like * SET SESSION AUTHORIZATION. */ -extern char *role_string; /* in guc.c */ +extern char *role_string; /* in guc_tables.c */ bool check_role(char **newval, void **extra, GucSource source) diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index b3747f4fd8..1a04bb1698 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -1557,7 +1557,7 @@ X509_NAME_to_cstring(X509_NAME *name) * Convert TLS protocol version GUC enum to OpenSSL values * * This is a straightforward one-to-one mapping, but doing it this way makes - * guc.c independent of OpenSSL availability and version. + * guc_tables.c independent of OpenSSL availability and version. * * If a version is passed that is not supported by the current OpenSSL * version, then we return -1. If a nonnegative value is returned, diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index a7071b2fce..1edb647158 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -1885,8 +1885,8 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h) * predictable transaction rate, but it offers some protection when * there's no walsender connection. Note that we are assuming * vacuum_defer_cleanup_age isn't large enough to cause wraparound --- - * so guc.c should limit it to no more than the xidStopLimit threshold - * in varsup.c. Also note that we intentionally don't apply + * so guc_tables.c should limit it to no more than the xidStopLimit + * threshold in varsup.c. Also note that we intentionally don't apply * vacuum_defer_cleanup_age on standby servers. */ h->oldest_considered_running = diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index bfc352aed8..aec92ef5b9 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -364,9 +364,9 @@ static SERIALIZABLEXACT *OldCommittedSxact; * attempt to degrade performance (mostly as false positive serialization * failure) gracefully in the face of memory pressure. */ -int max_predicate_locks_per_xact; /* set by guc.c */ -int max_predicate_locks_per_relation; /* set by guc.c */ -int max_predicate_locks_per_page; /* set by guc.c */ +int max_predicate_locks_per_xact; /* set by guc_tables.c */ +int max_predicate_locks_per_relation; /* set by guc_tables.c */ +int max_predicate_locks_per_page; /* set by guc_tables.c */ /* * This provides a list of objects in order to track transactions diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 6dc117dea8..2b5fc562aa 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3041,7 +3041,7 @@ pg_get_functiondef(PG_FUNCTION_ARGS) * * Variables that are not so marked should just be emitted as * simple string literals. If the variable is not known to - * guc.c, we'll do that; this makes it unsafe to use + * guc_tables.c, we'll do that; this makes it unsafe to use * GUC_LIST_QUOTE for extension variables. */ if (GetConfigOptionFlags(configitem, true) & GUC_LIST_QUOTE) diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c index 9ca9835aab..1f8080032e 100644 --- a/src/backend/utils/sort/tuplesort.c +++ b/src/backend/utils/sort/tuplesort.c @@ -1143,8 +1143,8 @@ grow_memtuples(Tuplesortstate *state) * On a 32-bit machine, allowedMem could exceed MaxAllocHugeSize. Clamp * to ensure our request won't be rejected. Note that we can easily * exhaust address space before facing this outcome. (This is presently - * impossible due to guc.c's MAX_KILOBYTES limitation on work_mem, but - * don't rely on that at this distance.) + * impossible due to guc_tables.c's MAX_KILOBYTES limitation on work_mem, + * but don't rely on that at this distance.) */ if ((Size) newmemtupsize >= MaxAllocHugeSize / sizeof(SortTuple)) { diff --git a/src/backend/utils/sort/tuplestore.c b/src/backend/utils/sort/tuplestore.c index bc36662198..6d8260673c 100644 --- a/src/backend/utils/sort/tuplestore.c +++ b/src/backend/utils/sort/tuplestore.c @@ -648,8 +648,8 @@ grow_memtuples(Tuplestorestate *state) * On a 32-bit machine, allowedMem could exceed MaxAllocHugeSize. Clamp * to ensure our request won't be rejected. Note that we can easily * exhaust address space before facing this outcome. (This is presently - * impossible due to guc.c's MAX_KILOBYTES limitation on work_mem, but - * don't rely on that at this distance.) + * impossible due to guc_tables.c's MAX_KILOBYTES limitation on work_mem, + * but don't rely on that at this distance.) */ if ((Size) newmemtupsize >= MaxAllocHugeSize / sizeof(void *)) { diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c index 9753a6d868..233ac7fbc9 100644 --- a/src/bin/pg_dump/dumputils.c +++ b/src/bin/pg_dump/dumputils.c @@ -680,10 +680,11 @@ emitShSecLabels(PGconn *conn, PGresult *res, PQExpBuffer buffer, * * It'd be better if we could inquire this directly from the backend; but even * if there were a function for that, it could only tell us about variables - * currently known to guc.c, so that it'd be unsafe for extensions to declare - * GUC_LIST_QUOTE variables anyway. Lacking a solution for that, it doesn't - * seem worth the work to do more than have this list, which must be kept in - * sync with the variables actually marked GUC_LIST_QUOTE in guc.c. + * currently known to guc_tables.c, so that it'd be unsafe for extensions to + * declare GUC_LIST_QUOTE variables anyway. Lacking a solution for that, it + * doesn't seem worth the work to do more than have this list, which must be + * kept in sync with the variables actually marked GUC_LIST_QUOTE in + * guc_tables.c. */ bool variable_is_guc_list_quote(const char *name) diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index c309e0233d..06a86f9ac1 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -291,7 +291,7 @@ extern void PreventCommandIfReadOnly(const char *cmdname); extern void PreventCommandIfParallelMode(const char *cmdname); extern void PreventCommandDuringRecovery(const char *cmdname); -/* in utils/misc/guc.c */ +/* in utils/misc/guc_tables.c */ extern PGDLLIMPORT int trace_recovery_messages; extern int trace_recovery(int trace_level); diff --git a/src/test/modules/test_misc/t/003_check_guc.pl b/src/test/modules/test_misc/t/003_check_guc.pl index 1786cd1929..e9f33f3c77 100644 --- a/src/test/modules/test_misc/t/003_check_guc.pl +++ b/src/test/modules/test_misc/t/003_check_guc.pl @@ -13,7 +13,7 @@ $node->start; # Grab the names of all the parameters that can be listed in the # configuration sample file. config_file is an exception, it is not -# in postgresql.conf.sample but is part of the lists from guc.c. +# in postgresql.conf.sample but is part of the lists from guc_tables.c. my $all_params = $node->safe_psql( 'postgres', "SELECT name @@ -82,7 +82,7 @@ is(scalar(@missing_from_file), 0, "no parameters missing from postgresql.conf.sample"); my @missing_from_list = grep(!$all_params_hash{$_}, @gucs_in_file); -is(scalar(@missing_from_list), 0, "no parameters missing from guc.c"); +is(scalar(@missing_from_list), 0, "no parameters missing from guc_tables.c"); my @sample_intersect = grep($not_in_sample_hash{$_}, @gucs_in_file); is(scalar(@sample_intersect), @@ -91,12 +91,12 @@ is(scalar(@sample_intersect), # These would log some information only on errors. foreach my $param (@missing_from_file) { - print("found GUC $param in guc.c, missing from postgresql.conf.sample\n"); + print("found GUC $param in guc_tables.c, missing from postgresql.conf.sample\n"); } foreach my $param (@missing_from_list) { print( - "found GUC $param in postgresql.conf.sample, with incorrect info in guc.c\n" + "found GUC $param in postgresql.conf.sample, with incorrect info in guc_tables.c\n" ); } foreach my $param (@sample_intersect) diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c index 89b69fd2af..c03078f7c8 100644 --- a/src/timezone/pgtz.c +++ b/src/timezone/pgtz.c @@ -364,7 +364,7 @@ pg_timezone_initialize(void) * We may not yet know where PGSHAREDIR is (in particular this is true in * an EXEC_BACKEND subprocess). So use "GMT", which pg_tzset forces to be * interpreted without reference to the filesystem. This corresponds to - * the bootstrap default for these variables in guc.c, although in + * the bootstrap default for these variables in guc_tables.c, although in * principle it could be different. */ session_timezone = pg_tzset("GMT"); -- 2.32.1 (Apple Git-133)