diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 613f2e159c..c4455c8389 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -201,6 +201,11 @@ tablespace_list_append(const char *arg) exit(1); } + /* + * Comparisons done with those values should involve similarly + * canonicalized path values. This is particularly sensitive on + * Windows where path values may not necessarily use Unix slashes. + */ canonicalize_path(cell->old_dir); canonicalize_path(cell->new_dir); @@ -1127,6 +1132,11 @@ static const char * get_tablespace_mapping(const char *dir) { TablespaceListCell *cell; + char canon_dir[MAXPGPATH]; + + /* Canonicalize path for comparison consistency */ + strcpy(canon_dir, dir); + canonicalize_path(canon_dir); for (cell = tablespace_dirs.head; cell; cell = cell->next) if (strcmp(dir, cell->old_dir) == 0)