Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a55a984

Browse files
committed
Sync guc.c and postgresql.conf.sample with the SGML docs.
It seems that various people have moved GUCs around in the config.sgml listing without bothering to make the code agree. Ensure that the config_group codes assigned to GUCs match where they are listed in config.sgml. Likewise ensure that postgresql.conf.sample lists GUCs in the same sub-section and same ordering as they appear in config.sgml. (I've got some doubts about some of these choices, but for the purposes of this patch, we'll treat config.sgml as gospel.) Notably, this requires adding a WAL_RECOVERY config_group value, because 1d25757 didn't. As long as we're renumbering that enum anyway, let's take out the values corresponding to major groups that are divided into sub-groups. No GUC should be assigned to the major group itself, so those values just create a temptation to do the wrong thing, while adding work for translators. In passing, adjust the short_desc strings for PRESET_OPTIONS GUCs to uniformly use the phrasing "Shows XYZ.", removing the impression some of these strings left that you can set the value. While some of these errors are old, no back-patch, as changing the contents of the pg_settings view in stable branches seems more likely to be seen as a compatibility break than anything helpful. Bharath Rupireddy, Justin Pryzby, Tom Lane Discussion: https://postgr.es/m/16997-ff16127f6e0d1390@postgresql.org Discussion: https://postgr.es/m/20210413123139.GE6091@telsasoft.com
1 parent f9b809e commit a55a984

File tree

3 files changed

+71
-95
lines changed

3 files changed

+71
-95
lines changed

src/backend/utils/misc/guc.c

+20-36
Original file line numberDiff line numberDiff line change
@@ -703,16 +703,12 @@ const char *const config_group_names[] =
703703
gettext_noop("Ungrouped"),
704704
/* FILE_LOCATIONS */
705705
gettext_noop("File Locations"),
706-
/* CONN_AUTH */
707-
gettext_noop("Connections and Authentication"),
708706
/* CONN_AUTH_SETTINGS */
709707
gettext_noop("Connections and Authentication / Connection Settings"),
710708
/* CONN_AUTH_AUTH */
711709
gettext_noop("Connections and Authentication / Authentication"),
712710
/* CONN_AUTH_SSL */
713711
gettext_noop("Connections and Authentication / SSL"),
714-
/* RESOURCES */
715-
gettext_noop("Resource Usage"),
716712
/* RESOURCES_MEM */
717713
gettext_noop("Resource Usage / Memory"),
718714
/* RESOURCES_DISK */
@@ -725,20 +721,18 @@ const char *const config_group_names[] =
725721
gettext_noop("Resource Usage / Background Writer"),
726722
/* RESOURCES_ASYNCHRONOUS */
727723
gettext_noop("Resource Usage / Asynchronous Behavior"),
728-
/* WAL */
729-
gettext_noop("Write-Ahead Log"),
730724
/* WAL_SETTINGS */
731725
gettext_noop("Write-Ahead Log / Settings"),
732726
/* WAL_CHECKPOINTS */
733727
gettext_noop("Write-Ahead Log / Checkpoints"),
734728
/* WAL_ARCHIVING */
735729
gettext_noop("Write-Ahead Log / Archiving"),
730+
/* WAL_RECOVERY */
731+
gettext_noop("Write-Ahead Log / Recovery"),
736732
/* WAL_ARCHIVE_RECOVERY */
737733
gettext_noop("Write-Ahead Log / Archive Recovery"),
738734
/* WAL_RECOVERY_TARGET */
739735
gettext_noop("Write-Ahead Log / Recovery Target"),
740-
/* REPLICATION */
741-
gettext_noop("Replication"),
742736
/* REPLICATION_SENDING */
743737
gettext_noop("Replication / Sending Servers"),
744738
/* REPLICATION_PRIMARY */
@@ -747,8 +741,6 @@ const char *const config_group_names[] =
747741
gettext_noop("Replication / Standby Servers"),
748742
/* REPLICATION_SUBSCRIBERS */
749743
gettext_noop("Replication / Subscribers"),
750-
/* QUERY_TUNING */
751-
gettext_noop("Query Tuning"),
752744
/* QUERY_TUNING_METHOD */
753745
gettext_noop("Query Tuning / Planner Method Configuration"),
754746
/* QUERY_TUNING_COST */
@@ -757,26 +749,20 @@ const char *const config_group_names[] =
757749
gettext_noop("Query Tuning / Genetic Query Optimizer"),
758750
/* QUERY_TUNING_OTHER */
759751
gettext_noop("Query Tuning / Other Planner Options"),
760-
/* LOGGING */
761-
gettext_noop("Reporting and Logging"),
762752
/* LOGGING_WHERE */
763753
gettext_noop("Reporting and Logging / Where to Log"),
764754
/* LOGGING_WHEN */
765755
gettext_noop("Reporting and Logging / When to Log"),
766756
/* LOGGING_WHAT */
767757
gettext_noop("Reporting and Logging / What to Log"),
768758
/* PROCESS_TITLE */
769-
gettext_noop("Process Title"),
770-
/* STATS */
771-
gettext_noop("Statistics"),
759+
gettext_noop("Reporting and Logging / Process Title"),
772760
/* STATS_MONITORING */
773761
gettext_noop("Statistics / Monitoring"),
774762
/* STATS_COLLECTOR */
775763
gettext_noop("Statistics / Query and Index Statistics Collector"),
776764
/* AUTOVACUUM */
777765
gettext_noop("Autovacuum"),
778-
/* CLIENT_CONN */
779-
gettext_noop("Client Connection Defaults"),
780766
/* CLIENT_CONN_STATEMENT */
781767
gettext_noop("Client Connection Defaults / Statement Behavior"),
782768
/* CLIENT_CONN_LOCALE */
@@ -787,8 +773,6 @@ const char *const config_group_names[] =
787773
gettext_noop("Client Connection Defaults / Other Defaults"),
788774
/* LOCK_MANAGEMENT */
789775
gettext_noop("Lock Management"),
790-
/* COMPAT_OPTIONS */
791-
gettext_noop("Version and Platform Compatibility"),
792776
/* COMPAT_OPTIONS_PREVIOUS */
793777
gettext_noop("Version and Platform Compatibility / Previous PostgreSQL Versions"),
794778
/* COMPAT_OPTIONS_CLIENT */
@@ -1188,7 +1172,7 @@ static struct config_bool ConfigureNamesBool[] =
11881172
check_bonjour, NULL, NULL
11891173
},
11901174
{
1191-
{"track_commit_timestamp", PGC_POSTMASTER, REPLICATION,
1175+
{"track_commit_timestamp", PGC_POSTMASTER, REPLICATION_SENDING,
11921176
gettext_noop("Collects transaction commit time."),
11931177
NULL
11941178
},
@@ -1297,7 +1281,7 @@ static struct config_bool ConfigureNamesBool[] =
12971281
NULL, NULL, NULL
12981282
},
12991283
{
1300-
{"recovery_prefetch", PGC_SIGHUP, WAL_SETTINGS,
1284+
{"recovery_prefetch", PGC_SIGHUP, WAL_RECOVERY,
13011285
gettext_noop("Prefetch referenced blocks during recovery."),
13021286
gettext_noop("Read ahead of the current replay position to find uncached blocks.")
13031287
},
@@ -1306,7 +1290,7 @@ static struct config_bool ConfigureNamesBool[] =
13061290
NULL, assign_recovery_prefetch, NULL
13071291
},
13081292
{
1309-
{"recovery_prefetch_fpw", PGC_SIGHUP, WAL_SETTINGS,
1293+
{"recovery_prefetch_fpw", PGC_SIGHUP, WAL_RECOVERY,
13101294
gettext_noop("Prefetch blocks that have full page images in the WAL."),
13111295
gettext_noop("On some systems, there is no benefit to prefetching pages that will be "
13121296
"entirely overwritten, but if the logical page size of the filesystem is "
@@ -1869,7 +1853,7 @@ static struct config_bool ConfigureNamesBool[] =
18691853

18701854
{
18711855
{"integer_datetimes", PGC_INTERNAL, PRESET_OPTIONS,
1872-
gettext_noop("Datetimes are integer based."),
1856+
gettext_noop("Shows whether datetimes are integer based."),
18731857
NULL,
18741858
GUC_REPORT | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
18751859
},
@@ -2416,7 +2400,7 @@ static struct config_int ConfigureNamesInt[] =
24162400

24172401
{
24182402
{"data_directory_mode", PGC_INTERNAL, PRESET_OPTIONS,
2419-
gettext_noop("Mode of the data directory."),
2403+
gettext_noop("Shows the mode of the data directory."),
24202404
gettext_noop("The parameter value is a numeric mode specification "
24212405
"in the form accepted by the chmod and umask system "
24222406
"calls. (To use the customary octal format the number "
@@ -2772,7 +2756,7 @@ static struct config_int ConfigureNamesInt[] =
27722756
},
27732757

27742758
{
2775-
{"wal_decode_buffer_size", PGC_POSTMASTER, WAL_ARCHIVE_RECOVERY,
2759+
{"wal_decode_buffer_size", PGC_POSTMASTER, WAL_RECOVERY,
27762760
gettext_noop("Maximum buffer size for reading ahead in the WAL during recovery."),
27772761
gettext_noop("This controls the maximum distance we can read ahead in the WAL to prefetch referenced blocks."),
27782762
GUC_UNIT_BYTE
@@ -3393,7 +3377,7 @@ static struct config_int ConfigureNamesInt[] =
33933377
},
33943378

33953379
{
3396-
{"tcp_keepalives_idle", PGC_USERSET, CLIENT_CONN_OTHER,
3380+
{"tcp_keepalives_idle", PGC_USERSET, CONN_AUTH_SETTINGS,
33973381
gettext_noop("Time between issuing TCP keepalives."),
33983382
gettext_noop("A value of 0 uses the system default."),
33993383
GUC_UNIT_S
@@ -3404,7 +3388,7 @@ static struct config_int ConfigureNamesInt[] =
34043388
},
34053389

34063390
{
3407-
{"tcp_keepalives_interval", PGC_USERSET, CLIENT_CONN_OTHER,
3391+
{"tcp_keepalives_interval", PGC_USERSET, CONN_AUTH_SETTINGS,
34083392
gettext_noop("Time between TCP keepalive retransmits."),
34093393
gettext_noop("A value of 0 uses the system default."),
34103394
GUC_UNIT_S
@@ -3426,7 +3410,7 @@ static struct config_int ConfigureNamesInt[] =
34263410
},
34273411

34283412
{
3429-
{"tcp_keepalives_count", PGC_USERSET, CLIENT_CONN_OTHER,
3413+
{"tcp_keepalives_count", PGC_USERSET, CONN_AUTH_SETTINGS,
34303414
gettext_noop("Maximum number of TCP keepalive retransmits."),
34313415
gettext_noop("This controls the number of consecutive keepalive retransmits that can be "
34323416
"lost before a connection is considered dead. A value of 0 uses the "
@@ -3506,7 +3490,7 @@ static struct config_int ConfigureNamesInt[] =
35063490
},
35073491

35083492
{
3509-
{"track_activity_query_size", PGC_POSTMASTER, RESOURCES_MEM,
3493+
{"track_activity_query_size", PGC_POSTMASTER, STATS_COLLECTOR,
35103494
gettext_noop("Sets the size reserved for pg_stat_activity.query, in bytes."),
35113495
NULL,
35123496
GUC_UNIT_BYTE
@@ -3528,7 +3512,7 @@ static struct config_int ConfigureNamesInt[] =
35283512
},
35293513

35303514
{
3531-
{"tcp_user_timeout", PGC_USERSET, CLIENT_CONN_OTHER,
3515+
{"tcp_user_timeout", PGC_USERSET, CONN_AUTH_SETTINGS,
35323516
gettext_noop("TCP user timeout."),
35333517
gettext_noop("A value of 0 uses the system default."),
35343518
GUC_UNIT_MS
@@ -3573,7 +3557,7 @@ static struct config_int ConfigureNamesInt[] =
35733557
},
35743558

35753559
{
3576-
{"client_connection_check_interval", PGC_USERSET, CLIENT_CONN_OTHER,
3560+
{"client_connection_check_interval", PGC_USERSET, CONN_AUTH_SETTINGS,
35773561
gettext_noop("Sets the time interval between checks for disconnection while running queries."),
35783562
NULL,
35793563
GUC_UNIT_MS
@@ -4102,7 +4086,7 @@ static struct config_string ConfigureNamesString[] =
41024086
/* See main.c about why defaults for LC_foo are not all alike */
41034087

41044088
{
4105-
{"lc_collate", PGC_INTERNAL, CLIENT_CONN_LOCALE,
4089+
{"lc_collate", PGC_INTERNAL, PRESET_OPTIONS,
41064090
gettext_noop("Shows the collation order locale."),
41074091
NULL,
41084092
GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
@@ -4113,7 +4097,7 @@ static struct config_string ConfigureNamesString[] =
41134097
},
41144098

41154099
{
4116-
{"lc_ctype", PGC_INTERNAL, CLIENT_CONN_LOCALE,
4100+
{"lc_ctype", PGC_INTERNAL, PRESET_OPTIONS,
41174101
gettext_noop("Shows the character classification and case conversion locale."),
41184102
NULL,
41194103
GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
@@ -4209,8 +4193,8 @@ static struct config_string ConfigureNamesString[] =
42094193

42104194
{
42114195
/* Can't be set in postgresql.conf */
4212-
{"server_encoding", PGC_INTERNAL, CLIENT_CONN_LOCALE,
4213-
gettext_noop("Sets the server (database) character set encoding."),
4196+
{"server_encoding", PGC_INTERNAL, PRESET_OPTIONS,
4197+
gettext_noop("Shows the server (database) character set encoding."),
42144198
NULL,
42154199
GUC_IS_NAME | GUC_REPORT | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
42164200
},
@@ -4429,7 +4413,7 @@ static struct config_string ConfigureNamesString[] =
44294413

44304414
{
44314415
{"ssl_library", PGC_INTERNAL, PRESET_OPTIONS,
4432-
gettext_noop("Name of the SSL library."),
4416+
gettext_noop("Shows the name of the SSL library."),
44334417
NULL,
44344418
GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
44354419
},

0 commit comments

Comments
 (0)