Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit056764b

Browse files
committed
pg_upgrade: quote directory names in delete_old_cluster script
This allows the delete script to properly function when specialcharacters appear in directory paths, e.g. spaces.Backpatch through 9.0
1 parent866f301 commit056764b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎contrib/pg_upgrade/check.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
528528
#endif
529529

530530
/* delete old cluster's default tablespace */
531-
fprintf(script,RMDIR_CMD"%s\n",fix_path_separator(old_cluster.pgdata));
531+
fprintf(script,RMDIR_CMD"\"%s\"\n",fix_path_separator(old_cluster.pgdata));
532532

533533
/* delete old cluster's alternate tablespaces */
534534
for (tblnum=0;tblnum<os_info.num_old_tablespaces;tblnum++)
@@ -550,7 +550,7 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
550550
PATH_SEPARATOR);
551551

552552
for (dbnum=0;dbnum<old_cluster.dbarr.ndbs;dbnum++)
553-
fprintf(script,RMDIR_CMD" %s%c%d\n",
553+
fprintf(script,RMDIR_CMD"\"%s%c%d\"\n",
554554
fix_path_separator(os_info.old_tablespaces[tblnum]),
555555
PATH_SEPARATOR,old_cluster.dbarr.dbs[dbnum].db_oid);
556556
}
@@ -562,7 +562,7 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
562562
* Simply delete the tablespace directory, which might be ".old"
563563
* or a version-specific subdirectory.
564564
*/
565-
fprintf(script,RMDIR_CMD" %s%s\n",
565+
fprintf(script,RMDIR_CMD"\"%s%s\"\n",
566566
fix_path_separator(os_info.old_tablespaces[tblnum]),
567567
fix_path_separator(suffix_path));
568568
pfree(suffix_path);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp