Commit 9af34cde authored by Magnus Hagander's avatar Magnus Hagander

Revert behaviour of -x/--xlog to 9.1 semantics

To replace it, add -X/--xlog-method that allows the specification
of fetch or stream.

Do this to avoid unnecessary backwards-incompatiblity. Spotted and
suggested by Peter Eisentraut.
parent 927d61ee
...@@ -186,8 +186,8 @@ PostgreSQL documentation ...@@ -186,8 +186,8 @@ PostgreSQL documentation
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-x <replaceable class="parameter">method</replaceable></option></term> <term><option>-X <replaceable class="parameter">method</replaceable></option></term>
<term><option>--xlog=<replaceable class="parameter">method</replaceable></option></term> <term><option>--xlog-method=<replaceable class="parameter">method</replaceable></option></term>
<listitem> <listitem>
<para> <para>
Includes the required transaction log files (WAL files) in the Includes the required transaction log files (WAL files) in the
...@@ -237,6 +237,17 @@ PostgreSQL documentation ...@@ -237,6 +237,17 @@ PostgreSQL documentation
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>-x</option></term>
<term><option>--xlog</option></term>
<listitem>
<para>
Using this option is equivalent of using <literal>-X</literal> with
method <literal>fetch</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><option>-z</option></term> <term><option>-z</option></term>
<term><option>--gzip</option></term> <term><option>--gzip</option></term>
......
...@@ -107,7 +107,9 @@ usage(void) ...@@ -107,7 +107,9 @@ usage(void)
printf(_("\nOptions controlling the output:\n")); printf(_("\nOptions controlling the output:\n"));
printf(_(" -D, --pgdata=DIRECTORY receive base backup into directory\n")); printf(_(" -D, --pgdata=DIRECTORY receive base backup into directory\n"));
printf(_(" -F, --format=p|t output format (plain (default), tar)\n")); printf(_(" -F, --format=p|t output format (plain (default), tar)\n"));
printf(_(" -x, --xlog=fetch|stream include required WAL files in backup\n")); printf(_(" -x, --xlog include required WAL files in backup (fetch mode)\n"));
printf(_(" -X, --xlog-method=fetch|stream\n"
" include required WAL files with specified method\n"));
printf(_(" -z, --gzip compress tar output\n")); printf(_(" -z, --gzip compress tar output\n"));
printf(_(" -Z, --compress=0-9 compress tar output with given compression level\n")); printf(_(" -Z, --compress=0-9 compress tar output with given compression level\n"));
printf(_("\nGeneral options:\n")); printf(_("\nGeneral options:\n"));
...@@ -1194,7 +1196,8 @@ main(int argc, char **argv) ...@@ -1194,7 +1196,8 @@ main(int argc, char **argv)
{"pgdata", required_argument, NULL, 'D'}, {"pgdata", required_argument, NULL, 'D'},
{"format", required_argument, NULL, 'F'}, {"format", required_argument, NULL, 'F'},
{"checkpoint", required_argument, NULL, 'c'}, {"checkpoint", required_argument, NULL, 'c'},
{"xlog", required_argument, NULL, 'x'}, {"xlog", no_argument, NULL, 'x'},
{"xlog-method", required_argument, NULL, 'X'},
{"gzip", no_argument, NULL, 'z'}, {"gzip", no_argument, NULL, 'z'},
{"compress", required_argument, NULL, 'Z'}, {"compress", required_argument, NULL, 'Z'},
{"label", required_argument, NULL, 'l'}, {"label", required_argument, NULL, 'l'},
...@@ -1230,7 +1233,7 @@ main(int argc, char **argv) ...@@ -1230,7 +1233,7 @@ main(int argc, char **argv)
} }
} }
while ((c = getopt_long(argc, argv, "D:F:x:l:zZ:c:h:p:U:s:wWvP", while ((c = getopt_long(argc, argv, "D:F:xX:l:zZ:c:h:p:U:s:wWvP",
long_options, &option_index)) != -1) long_options, &option_index)) != -1)
{ {
switch (c) switch (c)
...@@ -1251,6 +1254,24 @@ main(int argc, char **argv) ...@@ -1251,6 +1254,24 @@ main(int argc, char **argv)
} }
break; break;
case 'x': case 'x':
if (includewal)
{
fprintf(stderr, _("%s: cannot specify both --xlog and --xlog-method\n"),
progname);
exit(1);
}
includewal = true;
streamwal = false;
break;
case 'X':
if (includewal)
{
fprintf(stderr, _("%s: cannot specify both --xlog and --xlog-method\n"),
progname);
exit(1);
}
includewal = true; includewal = true;
if (strcmp(optarg, "f") == 0 || if (strcmp(optarg, "f") == 0 ||
strcmp(optarg, "fetch") == 0) strcmp(optarg, "fetch") == 0)
...@@ -1260,7 +1281,7 @@ main(int argc, char **argv) ...@@ -1260,7 +1281,7 @@ main(int argc, char **argv)
streamwal = true; streamwal = true;
else else
{ {
fprintf(stderr, _("%s: invalid xlog option \"%s\", must be empty, \"fetch\", or \"stream\"\n"), fprintf(stderr, _("%s: invalid xlog-method option \"%s\", must be empty, \"fetch\", or \"stream\"\n"),
progname, optarg); progname, optarg);
exit(1); exit(1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment