Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
0829c708
Commit
0829c708
authored
Sep 04, 2012
by
Andrew Dunstan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix command echoing in pg_upgade's analyze script for Windows.
parent
bd46b521
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
contrib/pg_upgrade/check.c
contrib/pg_upgrade/check.c
+10
-7
contrib/pg_upgrade/pg_upgrade.h
contrib/pg_upgrade/pg_upgrade.h
+2
-0
No files found.
contrib/pg_upgrade/check.c
View file @
0829c708
...
...
@@ -450,6 +450,9 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
#ifndef WIN32
/* add shebang header */
fprintf
(
script
,
"#!/bin/sh
\n\n
"
);
#else
/* suppress command echoing */
fprintf
(
script
,
"@echo off"
);
#endif
fprintf
(
script
,
"echo %sThis script will generate minimal optimizer statistics rapidly%s
\n
"
,
...
...
@@ -460,7 +463,7 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
ECHO_QUOTE
,
ECHO_QUOTE
);
fprintf
(
script
,
"echo %shave the default level of optimizer statistics.%s
\n
"
,
ECHO_QUOTE
,
ECHO_QUOTE
);
fprintf
(
script
,
"echo
\n\n
"
);
fprintf
(
script
,
"echo
%s
\n\n
"
,
ECHO_BLANK
);
fprintf
(
script
,
"echo %sIf you have used ALTER TABLE to modify the statistics target for%s
\n
"
,
ECHO_QUOTE
,
ECHO_QUOTE
);
...
...
@@ -468,7 +471,7 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
ECHO_QUOTE
,
ECHO_QUOTE
);
fprintf
(
script
,
"echo %srunning this script because they will delay fast statistics generation.%s
\n
"
,
ECHO_QUOTE
,
ECHO_QUOTE
);
fprintf
(
script
,
"echo
\n\n
"
);
fprintf
(
script
,
"echo
%s
\n\n
"
,
ECHO_BLANK
);
fprintf
(
script
,
"echo %sIf you would like default statistics as quickly as possible, cancel%s
\n
"
,
ECHO_QUOTE
,
ECHO_QUOTE
);
...
...
@@ -478,7 +481,7 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
/* Did we copy the free space files? */
(
GET_MAJOR_VERSION
(
old_cluster
.
major_version
)
>=
804
)
?
"--analyze-only"
:
"--analyze"
,
ECHO_QUOTE
);
fprintf
(
script
,
"echo
\n\n
"
);
fprintf
(
script
,
"echo
%s
\n\n
"
,
ECHO_BLANK
);
#ifndef WIN32
fprintf
(
script
,
"sleep 2
\n
"
);
...
...
@@ -496,12 +499,12 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
fprintf
(
script
,
"echo %s--------------------------------------------------%s
\n
"
,
ECHO_QUOTE
,
ECHO_QUOTE
);
fprintf
(
script
,
"vacuumdb --all --analyze-only
\n
"
);
fprintf
(
script
,
"echo
\n
"
);
fprintf
(
script
,
"echo
%s
\n
"
,
ECHO_BLANK
);
fprintf
(
script
,
"echo %sThe server is now available with minimal optimizer statistics.%s
\n
"
,
ECHO_QUOTE
,
ECHO_QUOTE
);
fprintf
(
script
,
"echo %sQuery performance will be optimal once this script completes.%s
\n
"
,
ECHO_QUOTE
,
ECHO_QUOTE
);
fprintf
(
script
,
"echo
\n\n
"
);
fprintf
(
script
,
"echo
%s
\n\n
"
,
ECHO_BLANK
);
#ifndef WIN32
fprintf
(
script
,
"sleep 2
\n
"
);
...
...
@@ -517,7 +520,7 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
fprintf
(
script
,
"echo %s---------------------------------------------------%s
\n
"
,
ECHO_QUOTE
,
ECHO_QUOTE
);
fprintf
(
script
,
"vacuumdb --all --analyze-only
\n
"
);
fprintf
(
script
,
"echo
\n\n
"
);
fprintf
(
script
,
"echo
%s
\n\n
"
,
ECHO_BLANK
);
#ifndef WIN32
fprintf
(
script
,
"unset PGOPTIONS
\n
"
);
...
...
@@ -534,7 +537,7 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
(
GET_MAJOR_VERSION
(
old_cluster
.
major_version
)
>=
804
)
?
"--analyze-only"
:
"--analyze"
);
fprintf
(
script
,
"echo
\n\n
"
);
fprintf
(
script
,
"echo
%s
\n\n
"
,
ECHO_BLANK
);
fprintf
(
script
,
"echo %sDone%s
\n
"
,
ECHO_QUOTE
,
ECHO_QUOTE
);
...
...
contrib/pg_upgrade/pg_upgrade.h
View file @
0829c708
...
...
@@ -77,6 +77,7 @@ extern char *output_files[];
#define RMDIR_CMD "rm -rf"
#define SCRIPT_EXT "sh"
#define ECHO_QUOTE "'"
#define ECHO_BLANK ""
#else
#define pg_copy_file CopyFile
#define pg_mv_file pgrename
...
...
@@ -88,6 +89,7 @@ extern char *output_files[];
#define SCRIPT_EXT "bat"
#define EXE_EXT ".exe"
#define ECHO_QUOTE ""
#define ECHO_BLANK "."
#endif
#define CLUSTER_NAME(cluster) ((cluster) == &old_cluster ? "old" : \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment