aboutsummaryrefslogtreecommitdiff
path: root/src/bin/initdb/initdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/initdb/initdb.c')
-rw-r--r--src/bin/initdb/initdb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 30e3701f92a..e6bb132beaf 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -1228,6 +1228,7 @@ setup_config(void)
char repltok[MAXPGPATH];
char path[MAXPGPATH];
const char *default_timezone;
+ char *autoconflines[3];
fputs(_("creating configuration files ... "), stdout);
fflush(stdout);
@@ -1320,6 +1321,21 @@ setup_config(void)
writefile(path, conflines);
chmod(path, S_IRUSR | S_IWUSR);
+ /*
+ * create the automatic configuration file to store the configuration
+ * parameters set by ALTER SYSTEM command. The parameters present in this
+ * file will override the value of parameters that exists before parse of
+ * this file.
+ */
+ autoconflines[0] = pg_strdup("# Do not edit this file manually! \n");
+ autoconflines[1] = pg_strdup("# It will be overwritten by the ALTER SYSTEM command. \n");
+ autoconflines[2] = NULL;
+
+ sprintf(path, "%s/%s", pg_data, PG_AUTOCONF_FILENAME);
+
+ writefile(path, autoconflines);
+ chmod(path, S_IRUSR | S_IWUSR);
+
free(conflines);