diff options
author | Michael Paquier | 2021-11-04 03:32:37 +0000 |
---|---|---|
committer | Michael Paquier | 2021-11-04 03:32:37 +0000 |
commit | 9588622945754305836555273a6a3be814db315c (patch) | |
tree | 44551c1b87b4ad345895bbcb4424160fabfb62d9 | |
parent | d62bcc8b07f921bad105c7a826702c117ea7be58 (diff) |
Fix some thinkos with pg_receivewal --compression-method
The option name was incorrect in one of the error messages, and the
short option 'I' was used in the code but we did not intend things to be
this way. While on it, fix the documentation to refer to a "method",
and not a "level.
Oversights in commit d62bcc8, that I have detected after more review of
the LZ4 patch for pg_receivewal.
-rw-r--r-- | doc/src/sgml/ref/pg_receivewal.sgml | 2 | ||||
-rw-r--r-- | src/bin/pg_basebackup/pg_receivewal.c | 26 |
2 files changed, 14 insertions, 14 deletions
diff --git a/doc/src/sgml/ref/pg_receivewal.sgml b/doc/src/sgml/ref/pg_receivewal.sgml index 44ed6791e8..79a4436ab9 100644 --- a/doc/src/sgml/ref/pg_receivewal.sgml +++ b/doc/src/sgml/ref/pg_receivewal.sgml @@ -264,7 +264,7 @@ PostgreSQL documentation </varlistentry> <varlistentry> - <term><option>--compression-method=<replaceable class="parameter">level</replaceable></option></term> + <term><option>--compression-method=<replaceable class="parameter">method</replaceable></option></term> <listitem> <para> Enables compression of write-ahead logs using the specified method. diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c index d47a59fe35..8acc0fc009 100644 --- a/src/bin/pg_basebackup/pg_receivewal.c +++ b/src/bin/pg_basebackup/pg_receivewal.c @@ -540,7 +540,6 @@ main(int argc, char **argv) {"status-interval", required_argument, NULL, 's'}, {"slot", required_argument, NULL, 'S'}, {"verbose", no_argument, NULL, 'v'}, - {"compression-method", required_argument, NULL, 'I'}, {"compress", required_argument, NULL, 'Z'}, /* action */ {"create-slot", no_argument, NULL, 1}, @@ -548,6 +547,7 @@ main(int argc, char **argv) {"if-not-exists", no_argument, NULL, 3}, {"synchronous", no_argument, NULL, 4}, {"no-sync", no_argument, NULL, 5}, + {"compression-method", required_argument, NULL, 6}, {NULL, 0, NULL, 0} }; @@ -626,18 +626,6 @@ main(int argc, char **argv) case 'v': verbose++; break; - case 'I': - if (pg_strcasecmp(optarg, "gzip") == 0) - compression_method = COMPRESSION_GZIP; - else if (pg_strcasecmp(optarg, "none") == 0) - compression_method = COMPRESSION_NONE; - else - { - pg_log_error("invalid value \"%s\" for option %s", - optarg, "--compress-method"); - exit(1); - } - break; case 'Z': if (!option_parse_int(optarg, "-Z/--compress", 1, 9, &compresslevel)) @@ -659,6 +647,18 @@ main(int argc, char **argv) case 5: do_sync = false; break; + case 6: + if (pg_strcasecmp(optarg, "gzip") == 0) + compression_method = COMPRESSION_GZIP; + else if (pg_strcasecmp(optarg, "none") == 0) + compression_method = COMPRESSION_NONE; + else + { + pg_log_error("invalid value \"%s\" for option %s", + optarg, "--compression-method"); + exit(1); + } + break; default: /* |