@@ -532,7 +532,8 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
532532#endif
533533
534534 /* delete old cluster's default tablespace */
535- fprintf (script , RMDIR_CMD " \"%s\"\n" , fix_path_separator (old_cluster .pgdata ));
535+ fprintf (script , RMDIR_CMD " %c%s%c\n" , PATH_QUOTE ,
536+ fix_path_separator (old_cluster .pgdata ), PATH_QUOTE );
536537
537538 /* delete old cluster's alternate tablespaces */
538539 for (tblnum = 0 ; tblnum < os_info .num_old_tablespaces ; tblnum ++ )
@@ -554,9 +555,10 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
554555 PATH_SEPARATOR );
555556
556557 for (dbnum = 0 ; dbnum < old_cluster .dbarr .ndbs ; dbnum ++ )
557- fprintf (script , RMDIR_CMD " \"% s%c%d\"\n" ,
558+ fprintf (script , RMDIR_CMD " %c% s%c%d%c\n" , PATH_QUOTE ,
558559 fix_path_separator (os_info .old_tablespaces [tblnum ]),
559- PATH_SEPARATOR , old_cluster .dbarr .dbs [dbnum ].db_oid );
560+ PATH_SEPARATOR , old_cluster .dbarr .dbs [dbnum ].db_oid ,
561+ PATH_QUOTE );
560562 }
561563 else
562564 {
@@ -566,9 +568,9 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
566568 * Simply delete the tablespace directory, which might be ".old"
567569 * or a version-specific subdirectory.
568570 */
569- fprintf (script , RMDIR_CMD " \"% s%s\"\n" ,
571+ fprintf (script , RMDIR_CMD " %c% s%s%c\n" , PATH_QUOTE ,
570572 fix_path_separator (os_info .old_tablespaces [tblnum ]),
571- fix_path_separator (suffix_path ));
573+ fix_path_separator (suffix_path ), PATH_QUOTE );
572574 pfree (suffix_path );
573575 }
574576 }
0 commit comments