From 1b66085133c11fb18da72c47f54c10c41c597578 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 24 Apr 2024 13:49:05 -0400 Subject: [PATCH v1] Fix small mistakes around pg_combinebackup with tablespaces. The --tablespace-mapping option was specified with required_argument rather than no_argument, which is wrong. Since the actual argument string passed to getopt_long() included "T:", the single-character form of the option still worked, but the long form did not. Repair. Also, the documentation erroneously stated that the tablespace mappings would be applied relative to the pathnames in the first backup specified on the command line. In fact, the tablespace mappings are interpreted relative to the final backup specified on the command line. Correct the error. Thanks to Tomas Vondra for alerting me to these mistakes. --- doc/src/sgml/ref/pg_combinebackup.sgml | 2 +- src/bin/pg_combinebackup/pg_combinebackup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/ref/pg_combinebackup.sgml b/doc/src/sgml/ref/pg_combinebackup.sgml index 96df3d81f1..89ee92d6a7 100644 --- a/doc/src/sgml/ref/pg_combinebackup.sgml +++ b/doc/src/sgml/ref/pg_combinebackup.sgml @@ -128,7 +128,7 @@ PostgreSQL documentation Relocates the tablespace in directory olddir to newdir during the backup. olddir is the absolute path of the tablespace - as it exists in the first backup specified on the command line, + as it exists in the final backup specified on the command line, and newdir is the absolute path to use for the tablespace in the reconstructed backup. If either path needs to contain an equal sign (=), precede that with a backslash. diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c b/src/bin/pg_combinebackup/pg_combinebackup.c index 4958372653..753c40874c 100644 --- a/src/bin/pg_combinebackup/pg_combinebackup.c +++ b/src/bin/pg_combinebackup/pg_combinebackup.c @@ -126,7 +126,7 @@ main(int argc, char *argv[]) {"dry-run", no_argument, NULL, 'n'}, {"no-sync", no_argument, NULL, 'N'}, {"output", required_argument, NULL, 'o'}, - {"tablespace-mapping", no_argument, NULL, 'T'}, + {"tablespace-mapping", required_argument, NULL, 'T'}, {"manifest-checksums", required_argument, NULL, 1}, {"no-manifest", no_argument, NULL, 2}, {"sync-method", required_argument, NULL, 3}, -- 2.39.3 (Apple Git-145)