Skip to content

Commit 7c619be

Browse files
committed
Fix typos in comments for ALTER SYSTEM.
Michael Paquier
1 parent 152d24f commit 7c619be

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

src/backend/utils/misc/guc-file.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ ProcessConfigFile(GucContext context)
149149
}
150150
151151
/*
152-
* Parse postgresql.auto.conf file after postgresql.conf to replace
152+
* Parse file PG_AUTOCONF_FILENAME after postgresql.conf to replace
153153
* parameters set by ALTER SYSTEM command. This file is present in
154154
* data directory, however when called during initdb data directory is not
155155
* set till this point, so use ConfigFile path which will be same.

src/backend/utils/misc/guc.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6457,9 +6457,9 @@ flatten_set_variable_args(const char *name, List *args)
64576457
}
64586458

64596459
/*
6460-
* Writes updated configuration parameter values into
6461-
* postgresql.auto.conf.temp file. It traverses the list of parameters
6462-
* and quote the string values before writing them to temporaray file.
6460+
* Write updated configuration parameter values into a temporary file.
6461+
* This function traverses the list of parameters and quotes the string
6462+
* values before writing them.
64636463
*/
64646464
static void
64656465
write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
@@ -6468,8 +6468,8 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
64686468
StringInfoData buf;
64696469

64706470
initStringInfo(&buf);
6471-
appendStringInfoString(&buf, "# Do not edit this file manually! \n");
6472-
appendStringInfoString(&buf, "# It will be overwritten by ALTER SYSTEM command. \n");
6471+
appendStringInfoString(&buf, "# Do not edit this file manually!\n");
6472+
appendStringInfoString(&buf, "# It will be overwritten by ALTER SYSTEM command.\n");
64736473

64746474
/*
64756475
* write the file header message before contents, so that if there is no
@@ -6517,7 +6517,7 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
65176517

65186518
/*
65196519
* This function takes list of all configuration parameters in
6520-
* postgresql.auto.conf and parameter to be updated as input arguments and
6520+
* PG_AUTOCONF_FILENAME and parameter to be updated as input arguments and
65216521
* replace the updated configuration parameter value in a list. If the
65226522
* parameter to be updated is new then it is appended to the list of
65236523
* parameters.
@@ -6595,13 +6595,12 @@ replace_auto_config_value(ConfigVariable **head_p, ConfigVariable **tail_p,
65956595
* and write them all to the automatic configuration file.
65966596
*
65976597
* The configuration parameters are written to a temporary
6598-
* file then renamed to the final name. The template for the
6599-
* temporary file is postgresql.auto.conf.temp.
6598+
* file then renamed to the final name.
66006599
*
66016600
* An LWLock is used to serialize writing to the same file.
66026601
*
66036602
* In case of an error, we leave the original automatic
6604-
* configuration file (postgresql.auto.conf) intact.
6603+
* configuration file (PG_AUTOCONF_FILENAME) intact.
66056604
*/
66066605
void
66076606
AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
@@ -6664,8 +6663,8 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
66646663

66656664

66666665
/*
6667-
* Use data directory as reference path for postgresql.auto.conf and it's
6668-
* corresponding temp file
6666+
* Use data directory as reference path for PG_AUTOCONF_FILENAME and its
6667+
* corresponding temporary file.
66696668
*/
66706669
join_path_components(AutoConfFileName, data_directory, PG_AUTOCONF_FILENAME);
66716670
canonicalize_path(AutoConfFileName);
@@ -6674,10 +6673,10 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
66746673
"temp");
66756674

66766675
/*
6677-
* one backend is allowed to operate on postgresql.auto.conf file, to
6676+
* One backend is allowed to operate on file PG_AUTOCONF_FILENAME, to
66786677
* ensure that we need to update the contents of the file with
66796678
* AutoFileLock. To ensure crash safety, first the contents are written to
6680-
* temporary file and then rename it to postgresql.auto.conf. In case
6679+
* a temporary file which is then renameed to PG_AUTOCONF_FILENAME. In case
66816680
* there exists a temp file from previous crash, that can be reused.
66826681
*/
66836682

@@ -6694,14 +6693,14 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
66946693
{
66956694
if (stat(AutoConfFileName, &st) == 0)
66966695
{
6697-
/* open postgresql.auto.conf file */
6696+
/* open file PG_AUTOCONF_FILENAME */
66986697
infile = AllocateFile(AutoConfFileName, "r");
66996698
if (infile == NULL)
67006699
ereport(ERROR,
67016700
(errmsg("failed to open auto conf file \"%s\": %m ",
67026701
AutoConfFileName)));
67036702

6704-
/* Parse the postgresql.auto.conf file */
6703+
/* parse it */
67056704
ParseConfigFp(infile, AutoConfFileName, 0, LOG, &head, &tail);
67066705

67076706
FreeFile(infile);
@@ -6713,7 +6712,7 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
67136712
*/
67146713
replace_auto_config_value(&head, &tail, AutoConfFileName, name, value);
67156714

6716-
/* Write and sync the New contents to postgresql.auto.conf.temp file */
6715+
/* Write and sync the new contents to the temporary file */
67176716
write_auto_conf_file(Tmpfd, AutoConfTmpFileName, &head);
67186717

67196718
close(Tmpfd);

src/bin/initdb/initdb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,8 +1300,8 @@ setup_config(void)
13001300
* file will override the value of parameters that exists before parse of
13011301
* this file.
13021302
*/
1303-
autoconflines[0] = pg_strdup("# Do not edit this file manually! \n");
1304-
autoconflines[1] = pg_strdup("# It will be overwritten by the ALTER SYSTEM command. \n");
1303+
autoconflines[0] = pg_strdup("# Do not edit this file manually!\n");
1304+
autoconflines[1] = pg_strdup("# It will be overwritten by the ALTER SYSTEM command.\n");
13051305
autoconflines[2] = NULL;
13061306

13071307
sprintf(path, "%s/%s", pg_data, PG_AUTOCONF_FILENAME);

src/include/pg_config_manual.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,6 @@
304304
/*
305305
* Automatic configuration file name for ALTER SYSTEM.
306306
* This file will be used to store values of configuration parameters
307-
* set by ALTER SYSTEM command
307+
* set by ALTER SYSTEM command.
308308
*/
309309
#define PG_AUTOCONF_FILENAME "postgresql.auto.conf"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy