diff --git a/doc/src/sgml/ref/initdb.sgml b/doc/src/sgml/ref/initdb.sgml index 585665f161..949b5a220f 100644 --- a/doc/src/sgml/ref/initdb.sgml +++ b/doc/src/sgml/ref/initdb.sgml @@ -316,16 +316,22 @@ PostgreSQL documentation - + - Set the WAL segment size, in megabytes. This is - the size of each individual file in the WAL log. It may be useful - to adjust this size to control the granularity of WAL log shipping. - This option can only be set during initialization, and cannot be - changed later. - The default size is 16 megabytes. - The value must be a power of 2 between 1 and 1024 (megabytes). + Set the WAL segment size, in megabytes. This + is the size of each individual file in the WAL log. The default size + is 16 megabytes. The value must be a power of 2 between 1 and 1024 + (megabytes). This option can only be set during initialization, and + cannot be changed later. + + + + It may be useful to adjust this size to control the granularity of + WAL log shipping or archiving. Also, in databases with a high volume + of WAL, the sheer number of WAL files per directory can become a + performance and management problem. Increasing the WAL file size + will reduce the number of WAL files. diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 970463441c..78990f5a27 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -3224,7 +3224,7 @@ main(int argc, char *argv[]) wal_segment_size_mb = strtol(str_wal_segment_size_mb, &endptr, 10); /* verify that wal segment size is valid */ - if (*endptr != '\0') + if (endptr == str_wal_segment_size_mb || *endptr != '\0') { fprintf(stderr, _("%s: argument of --wal-segsize must be a number\n"), @@ -3234,7 +3234,7 @@ main(int argc, char *argv[]) if (!IsValidWalSegSize(wal_segment_size_mb * 1024 * 1024)) { fprintf(stderr, - _("%s: argument of --wal-segsize must be a power of two between 1 and 1024\n"), + _("%s: argument of --wal-segsize must be a power of 2 between 1 and 1024\n"), progname); exit(1); }