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

Commit4ae178f

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 parent85dac37 commit4ae178f

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
@@ -432,7 +432,7 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
432432
#endif
433433

434434
/* delete old cluster's default tablespace */
435-
fprintf(script,RMDIR_CMD"%s\n",fix_path_separator(ctx,ctx->old.pgdata));
435+
fprintf(script,RMDIR_CMD"\"%s\"\n",fix_path_separator(ctx,ctx->old.pgdata));
436436

437437
/* delete old cluster's alternate tablespaces */
438438
for (tblnum=0;tblnum<ctx->num_tablespaces;tblnum++)
@@ -456,7 +456,7 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
456456

457457
for (dbnum=0;dbnum<ctx->new.dbarr.ndbs;dbnum++)
458458
{
459-
fprintf(script,RMDIR_CMD" %s%s%c%d\n",
459+
fprintf(script,RMDIR_CMD"\"%s%s%c%d\"\n",
460460
fix_path_separator(ctx,ctx->tablespaces[tblnum]),
461461
fix_path_separator(ctx,ctx->old.tablespace_suffix),
462462
PATH_SEPARATOR,ctx->old.dbarr.dbs[dbnum].db_oid);
@@ -468,7 +468,7 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
468468
* Simply delete the tablespace directory, which might be ".old"
469469
* or a version-specific subdirectory.
470470
*/
471-
fprintf(script,RMDIR_CMD" %s%s\n",
471+
fprintf(script,RMDIR_CMD"\"%s%s\"\n",
472472
fix_path_separator(ctx,ctx->tablespaces[tblnum]),
473473
fix_path_separator(ctx,ctx->old.tablespace_suffix));
474474
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp