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

Commit0829c70

Browse files
committed
Fix command echoing in pg_upgade's analyze script for Windows.
1 parentbd46b52 commit0829c70

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

‎contrib/pg_upgrade/check.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
450450
#ifndefWIN32
451451
/* add shebang header */
452452
fprintf(script,"#!/bin/sh\n\n");
453+
#else
454+
/* suppress command echoing */
455+
fprintf(script,"@echo off");
453456
#endif
454457

455458
fprintf(script,"echo %sThis script will generate minimal optimizer statistics rapidly%s\n",
@@ -460,15 +463,15 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
460463
ECHO_QUOTE,ECHO_QUOTE);
461464
fprintf(script,"echo %shave the default level of optimizer statistics.%s\n",
462465
ECHO_QUOTE,ECHO_QUOTE);
463-
fprintf(script,"echo\n\n");
466+
fprintf(script,"echo%s\n\n",ECHO_BLANK);
464467

465468
fprintf(script,"echo %sIf you have used ALTER TABLE to modify the statistics target for%s\n",
466469
ECHO_QUOTE,ECHO_QUOTE);
467470
fprintf(script,"echo %sany tables, you might want to remove them and restore them after%s\n",
468471
ECHO_QUOTE,ECHO_QUOTE);
469472
fprintf(script,"echo %srunning this script because they will delay fast statistics generation.%s\n",
470473
ECHO_QUOTE,ECHO_QUOTE);
471-
fprintf(script,"echo\n\n");
474+
fprintf(script,"echo%s\n\n",ECHO_BLANK);
472475

473476
fprintf(script,"echo %sIf you would like default statistics as quickly as possible, cancel%s\n",
474477
ECHO_QUOTE,ECHO_QUOTE);
@@ -478,7 +481,7 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
478481
/* Did we copy the free space files? */
479482
(GET_MAJOR_VERSION(old_cluster.major_version) >=804) ?
480483
"--analyze-only" :"--analyze",ECHO_QUOTE);
481-
fprintf(script,"echo\n\n");
484+
fprintf(script,"echo%s\n\n",ECHO_BLANK);
482485

483486
#ifndefWIN32
484487
fprintf(script,"sleep 2\n");
@@ -496,12 +499,12 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
496499
fprintf(script,"echo %s--------------------------------------------------%s\n",
497500
ECHO_QUOTE,ECHO_QUOTE);
498501
fprintf(script,"vacuumdb --all --analyze-only\n");
499-
fprintf(script,"echo\n");
502+
fprintf(script,"echo%s\n",ECHO_BLANK);
500503
fprintf(script,"echo %sThe server is now available with minimal optimizer statistics.%s\n",
501504
ECHO_QUOTE,ECHO_QUOTE);
502505
fprintf(script,"echo %sQuery performance will be optimal once this script completes.%s\n",
503506
ECHO_QUOTE,ECHO_QUOTE);
504-
fprintf(script,"echo\n\n");
507+
fprintf(script,"echo%s\n\n",ECHO_BLANK);
505508

506509
#ifndefWIN32
507510
fprintf(script,"sleep 2\n");
@@ -517,7 +520,7 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
517520
fprintf(script,"echo %s---------------------------------------------------%s\n",
518521
ECHO_QUOTE,ECHO_QUOTE);
519522
fprintf(script,"vacuumdb --all --analyze-only\n");
520-
fprintf(script,"echo\n\n");
523+
fprintf(script,"echo%s\n\n",ECHO_BLANK);
521524

522525
#ifndefWIN32
523526
fprintf(script,"unset PGOPTIONS\n");
@@ -534,7 +537,7 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
534537
(GET_MAJOR_VERSION(old_cluster.major_version) >=804) ?
535538
"--analyze-only" :"--analyze");
536539

537-
fprintf(script,"echo\n\n");
540+
fprintf(script,"echo%s\n\n",ECHO_BLANK);
538541
fprintf(script,"echo %sDone%s\n",
539542
ECHO_QUOTE,ECHO_QUOTE);
540543

‎contrib/pg_upgrade/pg_upgrade.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ extern char *output_files[];
7777
#defineRMDIR_CMD"rm -rf"
7878
#defineSCRIPT_EXT"sh"
7979
#defineECHO_QUOTE"'"
80+
#defineECHO_BLANK ""
8081
#else
8182
#definepg_copy_fileCopyFile
8283
#definepg_mv_filepgrename
@@ -88,6 +89,7 @@ extern char *output_files[];
8889
#defineSCRIPT_EXT"bat"
8990
#defineEXE_EXT".exe"
9091
#defineECHO_QUOTE""
92+
#defineECHO_BLANK "."
9193
#endif
9294

9395
#defineCLUSTER_NAME(cluster)((cluster) == &old_cluster ? "old" : \

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp