</listitem>
</varlistentry>
+ <varlistentry id="app-initdb-no-data-checksums" xreflabel="no data checksums">
+ <term><option>--no-data-checksums</option></term>
+ <listitem>
+ <para>
+ Do not enable data checksums. This can be used to override a
+ <option>--data-checksums</option> option.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="app-initdb-option-pwfile">
<term><option>--pwfile=<replaceable>filename</replaceable></option></term>
<listitem>
" set builtin locale name for new databases\n"));
printf(_(" --locale-provider={builtin|libc|icu}\n"
" set default locale provider for new databases\n"));
+ printf(_(" --no-data-checksums do not use data page checksums\n"));
printf(_(" --pwfile=FILE read password for the new superuser from file\n"));
printf(_(" -T, --text-search-config=CFG\n"
" default text search configuration\n"));
{"icu-locale", required_argument, NULL, 17},
{"icu-rules", required_argument, NULL, 18},
{"sync-method", required_argument, NULL, 19},
+ {"no-data-checksums", no_argument, NULL, 20},
{NULL, 0, NULL, 0}
};
if (!parse_sync_method(optarg, &sync_method))
exit(1);
break;
+ case 20:
+ data_checksums = false;
+ break;
default:
/* getopt_long already emitted a complaint */
pg_log_error_hint("Try \"%s --help\" for more information.", progname);
ok($conf !~ qr/^Work_Mem = /m, "Work_Mem should not be configured");
ok($conf =~ qr/^work_mem = 512/m, "work_mem should be in config");
+# Test the no-data-checksums flag
+my $datadir_nochecksums = "$tempdir/data_no_checksums";
+
+command_ok([ 'initdb', '--no-data-checksums', $datadir_nochecksums ],
+ 'successful creation without data checksums');
+
+# Control file should tell that data checksums are disabled.
+command_like(
+ [ 'pg_controldata', $datadir_nochecksums ],
+ qr/Data page checksum version:.*0/,
+ 'checksums are disabled in control file');
+
done_testing();