diff options
Diffstat (limited to 'src/bin/pg_basebackup/pg_basebackup.c')
-rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 749886877c8..1db3b53b796 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -323,12 +323,22 @@ tablespace_list_append(const char *arg) } /* - * This check isn't absolutely necessary. But all tablespaces are created - * with absolute directories, so specifying a non-absolute path here would - * just never match, possibly confusing users. It's also good to be - * consistent with the new_dir check. + * All tablespaces are created with absolute directories, so specifying a + * non-absolute path here would just never match, possibly confusing users. + * Since we don't know whether the remote side is Windows or not, and it + * might be different than the local side, permit any path that could be + * absolute under either set of rules. + * + * (There is little practical risk of confusion here, because someone + * running entirely on Linux isn't likely to have a relative path that + * begins with a backslash or something that looks like a drive + * specification. If they do, and they also incorrectly believe that + * a relative path is acceptable here, we'll silently fail to warn them + * of their mistake, and the -T option will just not get applied, same + * as if they'd specified -T for a nonexistent tablespace.) */ - if (!is_absolute_path(cell->old_dir)) + if (!is_nonwindows_absolute_path(cell->old_dir) && + !is_windows_absolute_path(cell->old_dir)) { pg_log_error("old directory is not an absolute path in tablespace mapping: %s", cell->old_dir); |