Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d30e5b

Browse files
committed
minor bugfix: ensure that tablespace directories are canonicalized
1 parent c3451c5 commit 7d30e5b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backup.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -3461,8 +3461,8 @@ check_external_for_tablespaces(parray *external_list)
34613461
int i = 0;
34623462
int j = 0;
34633463
char *tablespace_path = NULL;
3464-
char *query = "SELECT pg_catalog.pg_tablespace_location(oid)\n"
3465-
"FROM pg_tablespace\n"
3464+
char *query = "SELECT pg_catalog.pg_tablespace_location(oid) "
3465+
"FROM pg_catalog.pg_tablespace "
34663466
"WHERE pg_catalog.pg_tablespace_location(oid) <> '';";
34673467

34683468
conn = backup_conn;
@@ -3476,9 +3476,13 @@ check_external_for_tablespaces(parray *external_list)
34763476
{
34773477
tablespace_path = PQgetvalue(res, i, 0);
34783478
Assert (strlen(tablespace_path) > 0);
3479+
3480+
canonicalize_path(tablespace_path);
3481+
34793482
for (j = 0; j < parray_num(external_list); j++)
34803483
{
34813484
char *external_path = parray_get(external_list, j);
3485+
34823486
if (path_is_prefix_of_path(external_path, tablespace_path))
34833487
elog(ERROR, "External directory path (-E option) \"%s\" "
34843488
"contains tablespace \"%s\"",

0 commit comments

Comments
 (0)