Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit983a588

Browse files
committed
initdb: Add new option "--no-data-checksums"
Right now this does nothing except override any earlier--data-checksums option. But the idea is that --data-checksums couldbecome the default, and then this option would allow forcing it offinstead.Author: Greg Sabino Mullane <greg@turnstep.com>Discussion:https://www.postgresql.org/message-id/flat/CAKAnmmKwiMHik5AHmBEdf5vqzbOBbcwEPHo4-PioWeAbzwcTOQ@mail.gmail.com
1 parentefd72a3 commit983a588

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

‎doc/src/sgml/ref/initdb.sgml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,16 @@ PostgreSQL documentation
343343
</listitem>
344344
</varlistentry>
345345

346+
<varlistentry id="app-initdb-no-data-checksums" xreflabel="no data checksums">
347+
<term><option>--no-data-checksums</option></term>
348+
<listitem>
349+
<para>
350+
Do not enable data checksums. This can be used to override a
351+
<option>--data-checksums</option> option.
352+
</para>
353+
</listitem>
354+
</varlistentry>
355+
346356
<varlistentry id="app-initdb-option-pwfile">
347357
<term><option>--pwfile=<replaceable>filename</replaceable></option></term>
348358
<listitem>

‎src/bin/initdb/initdb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,6 +2466,7 @@ usage(const char *progname)
24662466
" set builtin locale name for new databases\n"));
24672467
printf(_(" --locale-provider={builtin|libc|icu}\n"
24682468
" set default locale provider for new databases\n"));
2469+
printf(_(" --no-data-checksums do not use data page checksums\n"));
24692470
printf(_(" --pwfile=FILE read password for the new superuser from file\n"));
24702471
printf(_(" -T, --text-search-config=CFG\n"
24712472
" default text search configuration\n"));
@@ -3128,6 +3129,7 @@ main(int argc, char *argv[])
31283129
{"icu-locale",required_argument,NULL,17},
31293130
{"icu-rules",required_argument,NULL,18},
31303131
{"sync-method",required_argument,NULL,19},
3132+
{"no-data-checksums",no_argument,NULL,20},
31313133
{NULL,0,NULL,0}
31323134
};
31333135

@@ -3319,6 +3321,9 @@ main(int argc, char *argv[])
33193321
if (!parse_sync_method(optarg,&sync_method))
33203322
exit(1);
33213323
break;
3324+
case20:
3325+
data_checksums= false;
3326+
break;
33223327
default:
33233328
/* getopt_long already emitted a complaint */
33243329
pg_log_error_hint("Try \"%s --help\" for more information.",progname);

‎src/bin/initdb/t/001_initdb.pl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,16 @@
268268
ok($conf !~qr/^Work_Mem =/m,"Work_Mem should not be configured");
269269
ok($conf =~qr/^work_mem = 512/m,"work_mem should be in config");
270270

271+
# Test the no-data-checksums flag
272+
my$datadir_nochecksums ="$tempdir/data_no_checksums";
273+
274+
command_ok(['initdb','--no-data-checksums',$datadir_nochecksums ],
275+
'successful creation without data checksums');
276+
277+
# Control file should tell that data checksums are disabled.
278+
command_like(
279+
['pg_controldata',$datadir_nochecksums ],
280+
qr/Data page checksum version:.*0/,
281+
'checksums are disabled in control file');
282+
271283
done_testing();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp