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

Commit9d15292

Browse files
committed
pg_upgrade: use single or double-quotes in command-line strings
This is platform-dependent.
1 parent2078176 commit9d15292

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

‎src/bin/pg_upgrade/check.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

‎src/bin/pg_upgrade/pg_upgrade.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ extern char *output_files[];
7474
#definepg_mv_filerename
7575
#definepg_link_filelink
7676
#definePATH_SEPARATOR'/'
77+
#definePATH_QUOTE'\''
7778
#defineRM_CMD"rm -f"
7879
#defineRMDIR_CMD"rm -rf"
7980
#defineSCRIPT_PREFIX"./"
@@ -85,6 +86,7 @@ extern char *output_files[];
8586
#definepg_mv_filepgrename
8687
#definepg_link_filewin32_pghardlink
8788
#definePATH_SEPARATOR'\\'
89+
#definePATH_QUOTE'"'
8890
#defineRM_CMD"DEL /q"
8991
#defineRMDIR_CMD"RMDIR /s/q"
9092
#defineSCRIPT_PREFIX""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp