diff options
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/initdb/initdb.c | 19 | ||||
-rw-r--r-- | src/bin/pg_controldata/pg_controldata.c | 2 | ||||
-rw-r--r-- | src/bin/pg_resetxlog/pg_resetxlog.c | 2 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index e16f3e3c80a..bb38796eb28 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -119,6 +119,7 @@ static bool noclean = false; static bool do_sync = true; static bool sync_only = false; static bool show_setting = false; +static bool data_checksums = false; static char *xlog_dir = ""; @@ -1441,8 +1442,10 @@ bootstrap_template1(void) unsetenv("PGCLIENTENCODING"); snprintf(cmd, sizeof(cmd), - "\"%s\" --boot -x1 %s %s", - backend_exec, boot_options, talkargs); + "\"%s\" --boot -x1 %s %s %s", + backend_exec, + data_checksums ? "-k" : "", + boot_options, talkargs); PG_CMD_OPEN; @@ -2748,6 +2751,7 @@ usage(const char *progname) printf(_(" -X, --xlogdir=XLOGDIR location for the transaction log directory\n")); printf(_("\nLess commonly used options:\n")); printf(_(" -d, --debug generate lots of debugging output\n")); + printf(_(" -k, --data-checksums data page checksums\n")); printf(_(" -L DIRECTORY where to find the input files\n")); printf(_(" -n, --noclean do not clean up after errors\n")); printf(_(" -N, --nosync do not wait for changes to be written safely to disk\n")); @@ -3424,6 +3428,7 @@ main(int argc, char *argv[]) {"nosync", no_argument, NULL, 'N'}, {"sync-only", no_argument, NULL, 'S'}, {"xlogdir", required_argument, NULL, 'X'}, + {"data-checksums", no_argument, NULL, 'k'}, {NULL, 0, NULL, 0} }; @@ -3455,7 +3460,7 @@ main(int argc, char *argv[]) /* process command-line options */ - while ((c = getopt_long(argc, argv, "dD:E:L:nNU:WA:sST:X:", long_options, &option_index)) != -1) + while ((c = getopt_long(argc, argv, "dD:E:kL:nNU:WA:sST:X:", long_options, &option_index)) != -1) { switch (c) { @@ -3504,6 +3509,9 @@ main(int argc, char *argv[]) case 'S': sync_only = true; break; + case 'k': + data_checksums = true; + break; case 'L': share_path = pg_strdup(optarg); break; @@ -3615,6 +3623,11 @@ main(int argc, char *argv[]) setup_locale_encoding(); setup_text_search(); + + if (data_checksums) + printf(_("Data page checksums are enabled.\n")); + else + printf(_("Data page checksums are disabled.\n")); printf("\n"); diff --git a/src/bin/pg_controldata/pg_controldata.c b/src/bin/pg_controldata/pg_controldata.c index 369f2fb0759..ceb412505bf 100644 --- a/src/bin/pg_controldata/pg_controldata.c +++ b/src/bin/pg_controldata/pg_controldata.c @@ -287,5 +287,7 @@ main(int argc, char *argv[]) (ControlFile.float4ByVal ? _("by value") : _("by reference"))); printf(_("Float8 argument passing: %s\n"), (ControlFile.float8ByVal ? _("by value") : _("by reference"))); + printf(_("Data page checksums: %s\n"), + (ControlFile.data_checksums ? _("enabled") : _("disabled"))); return 0; } diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c index acf9f8dd3e3..124dcfb7772 100644 --- a/src/bin/pg_resetxlog/pg_resetxlog.c +++ b/src/bin/pg_resetxlog/pg_resetxlog.c @@ -624,6 +624,8 @@ PrintControlValues(bool guessed) (ControlFile.float4ByVal ? _("by value") : _("by reference"))); printf(_("Float8 argument passing: %s\n"), (ControlFile.float8ByVal ? _("by value") : _("by reference"))); + printf(_("Data page checksums: %s\n"), + (ControlFile.data_checksums ? _("enabled") : _("disabled"))); } |