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
c824c7e2
Commit
c824c7e2
authored
Sep 09, 2017
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_upgrade: Message style fixes
parent
fdf87ed4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
16 deletions
+18
-16
src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/check.c
+1
-1
src/bin/pg_upgrade/exec.c
src/bin/pg_upgrade/exec.c
+4
-4
src/bin/pg_upgrade/file.c
src/bin/pg_upgrade/file.c
+1
-1
src/bin/pg_upgrade/option.c
src/bin/pg_upgrade/option.c
+9
-7
src/bin/pg_upgrade/pg_upgrade.c
src/bin/pg_upgrade/pg_upgrade.c
+2
-2
src/bin/pg_upgrade/server.c
src/bin/pg_upgrade/server.c
+1
-1
No files found.
src/bin/pg_upgrade/check.c
View file @
c824c7e2
...
@@ -987,7 +987,7 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
...
@@ -987,7 +987,7 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
bool
found
=
false
;
bool
found
=
false
;
char
output_path
[
MAXPGPATH
];
char
output_path
[
MAXPGPATH
];
prep_status
(
"Checking for incompatible
jsonb
data type"
);
prep_status
(
"Checking for incompatible
\"
jsonb
\"
data type"
);
snprintf
(
output_path
,
sizeof
(
output_path
),
"tables_using_jsonb.txt"
);
snprintf
(
output_path
,
sizeof
(
output_path
),
"tables_using_jsonb.txt"
);
...
...
src/bin/pg_upgrade/exec.c
View file @
c824c7e2
...
@@ -51,7 +51,7 @@ get_bin_version(ClusterInfo *cluster)
...
@@ -51,7 +51,7 @@ get_bin_version(ClusterInfo *cluster)
*
strchr
(
cmd_output
,
'\n'
)
=
'\0'
;
*
strchr
(
cmd_output
,
'\n'
)
=
'\0'
;
if
(
sscanf
(
cmd_output
,
"%*s %*s %d.%d"
,
&
pre_dot
,
&
post_dot
)
<
1
)
if
(
sscanf
(
cmd_output
,
"%*s %*s %d.%d"
,
&
pre_dot
,
&
post_dot
)
<
1
)
pg_fatal
(
"could not get
version
from %s
\n
"
,
cmd
);
pg_fatal
(
"could not get
pg_ctl version output
from %s
\n
"
,
cmd
);
cluster
->
bin_version
=
(
pre_dot
*
100
+
post_dot
)
*
100
;
cluster
->
bin_version
=
(
pre_dot
*
100
+
post_dot
)
*
100
;
}
}
...
@@ -143,7 +143,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
...
@@ -143,7 +143,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
#endif
#endif
if
(
log
==
NULL
)
if
(
log
==
NULL
)
pg_fatal
(
"c
annot write to log file %s
\n
"
,
log_file
);
pg_fatal
(
"c
ould not write to log file
\"
%s
\"
\n
"
,
log_file
);
#ifdef WIN32
#ifdef WIN32
/* Are we printing "command:" before its output? */
/* Are we printing "command:" before its output? */
...
@@ -198,7 +198,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
...
@@ -198,7 +198,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
* log these commands to a third file, but that just adds complexity.
* log these commands to a third file, but that just adds complexity.
*/
*/
if
((
log
=
fopen
(
log_file
,
"a"
))
==
NULL
)
if
((
log
=
fopen
(
log_file
,
"a"
))
==
NULL
)
pg_fatal
(
"c
annot write to log file %s
\n
"
,
log_file
);
pg_fatal
(
"c
ould not write to log file
\"
%s
\"
\n
"
,
log_file
);
fprintf
(
log
,
"
\n\n
"
);
fprintf
(
log
,
"
\n\n
"
);
fclose
(
log
);
fclose
(
log
);
#endif
#endif
...
@@ -426,7 +426,7 @@ validate_exec(const char *dir, const char *cmdName)
...
@@ -426,7 +426,7 @@ validate_exec(const char *dir, const char *cmdName)
pg_fatal
(
"check for
\"
%s
\"
failed: %s
\n
"
,
pg_fatal
(
"check for
\"
%s
\"
failed: %s
\n
"
,
path
,
strerror
(
errno
));
path
,
strerror
(
errno
));
else
if
(
!
S_ISREG
(
buf
.
st_mode
))
else
if
(
!
S_ISREG
(
buf
.
st_mode
))
pg_fatal
(
"check for
\"
%s
\"
failed: not a
n executable
file
\n
"
,
pg_fatal
(
"check for
\"
%s
\"
failed: not a
regular
file
\n
"
,
path
);
path
);
/*
/*
...
...
src/bin/pg_upgrade/file.c
View file @
c824c7e2
...
@@ -290,7 +290,7 @@ check_hard_link(void)
...
@@ -290,7 +290,7 @@ check_hard_link(void)
if
(
pg_link_file
(
existing_file
,
new_link_file
)
<
0
)
if
(
pg_link_file
(
existing_file
,
new_link_file
)
<
0
)
pg_fatal
(
"could not create hard link between old and new data directories: %s
\n
"
pg_fatal
(
"could not create hard link between old and new data directories: %s
\n
"
"In link mode the old and new data directories must be on the same file system
volume
.
\n
"
,
"In link mode the old and new data directories must be on the same file system.
\n
"
,
strerror
(
errno
));
strerror
(
errno
));
unlink
(
new_link_file
);
unlink
(
new_link_file
);
...
...
src/bin/pg_upgrade/option.c
View file @
c824c7e2
...
@@ -98,7 +98,7 @@ parseCommandLine(int argc, char *argv[])
...
@@ -98,7 +98,7 @@ parseCommandLine(int argc, char *argv[])
pg_fatal
(
"%s: cannot be run as root
\n
"
,
os_info
.
progname
);
pg_fatal
(
"%s: cannot be run as root
\n
"
,
os_info
.
progname
);
if
((
log_opts
.
internal
=
fopen_priv
(
INTERNAL_LOG_FILE
,
"a"
))
==
NULL
)
if
((
log_opts
.
internal
=
fopen_priv
(
INTERNAL_LOG_FILE
,
"a"
))
==
NULL
)
pg_fatal
(
"c
annot write to log file %s
\n
"
,
INTERNAL_LOG_FILE
);
pg_fatal
(
"c
ould not write to log file
\"
%s
\"
\n
"
,
INTERNAL_LOG_FILE
);
while
((
option
=
getopt_long
(
argc
,
argv
,
"d:D:b:B:cj:ko:O:p:P:rU:v"
,
while
((
option
=
getopt_long
(
argc
,
argv
,
"d:D:b:B:cj:ko:O:p:P:rU:v"
,
long_options
,
&
optindex
))
!=
-
1
)
long_options
,
&
optindex
))
!=
-
1
)
...
@@ -214,7 +214,7 @@ parseCommandLine(int argc, char *argv[])
...
@@ -214,7 +214,7 @@ parseCommandLine(int argc, char *argv[])
for
(
filename
=
output_files
;
*
filename
!=
NULL
;
filename
++
)
for
(
filename
=
output_files
;
*
filename
!=
NULL
;
filename
++
)
{
{
if
((
fp
=
fopen_priv
(
*
filename
,
"a"
))
==
NULL
)
if
((
fp
=
fopen_priv
(
*
filename
,
"a"
))
==
NULL
)
pg_fatal
(
"c
annot write to log file %s
\n
"
,
*
filename
);
pg_fatal
(
"c
ould not write to log file
\"
%s
\"
\n
"
,
*
filename
);
/* Start with newline because we might be appending to a file. */
/* Start with newline because we might be appending to a file. */
fprintf
(
fp
,
"
\n
"
fprintf
(
fp
,
"
\n
"
...
@@ -262,7 +262,7 @@ parseCommandLine(int argc, char *argv[])
...
@@ -262,7 +262,7 @@ parseCommandLine(int argc, char *argv[])
canonicalize_path
(
new_cluster_pgdata
);
canonicalize_path
(
new_cluster_pgdata
);
if
(
!
getcwd
(
cwd
,
MAXPGPATH
))
if
(
!
getcwd
(
cwd
,
MAXPGPATH
))
pg_fatal
(
"c
annot find
current directory
\n
"
);
pg_fatal
(
"c
ould not determine
current directory
\n
"
);
canonicalize_path
(
cwd
);
canonicalize_path
(
cwd
);
if
(
path_is_prefix_of_path
(
new_cluster_pgdata
,
cwd
))
if
(
path_is_prefix_of_path
(
new_cluster_pgdata
,
cwd
))
pg_fatal
(
"cannot run pg_upgrade from inside the new cluster data directory on Windows
\n
"
);
pg_fatal
(
"cannot run pg_upgrade from inside the new cluster data directory on Windows
\n
"
);
...
@@ -459,7 +459,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
...
@@ -459,7 +459,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
/* Use the current directory for the socket */
/* Use the current directory for the socket */
cluster
->
sockdir
=
pg_malloc
(
MAXPGPATH
);
cluster
->
sockdir
=
pg_malloc
(
MAXPGPATH
);
if
(
!
getcwd
(
cluster
->
sockdir
,
MAXPGPATH
))
if
(
!
getcwd
(
cluster
->
sockdir
,
MAXPGPATH
))
pg_fatal
(
"c
annot find
current directory
\n
"
);
pg_fatal
(
"c
ould not determine
current directory
\n
"
);
}
}
else
else
{
{
...
@@ -477,14 +477,16 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
...
@@ -477,14 +477,16 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
snprintf
(
filename
,
sizeof
(
filename
),
"%s/postmaster.pid"
,
snprintf
(
filename
,
sizeof
(
filename
),
"%s/postmaster.pid"
,
cluster
->
pgdata
);
cluster
->
pgdata
);
if
((
fp
=
fopen
(
filename
,
"r"
))
==
NULL
)
if
((
fp
=
fopen
(
filename
,
"r"
))
==
NULL
)
pg_fatal
(
"Cannot open file %s: %m
\n
"
,
filename
);
pg_fatal
(
"could not open file
\"
%s
\"
: %s
\n
"
,
filename
,
strerror
(
errno
));
for
(
lineno
=
1
;
for
(
lineno
=
1
;
lineno
<=
Max
(
LOCK_FILE_LINE_PORT
,
LOCK_FILE_LINE_SOCKET_DIR
);
lineno
<=
Max
(
LOCK_FILE_LINE_PORT
,
LOCK_FILE_LINE_SOCKET_DIR
);
lineno
++
)
lineno
++
)
{
{
if
(
fgets
(
line
,
sizeof
(
line
),
fp
)
==
NULL
)
if
(
fgets
(
line
,
sizeof
(
line
),
fp
)
==
NULL
)
pg_fatal
(
"Cannot read line %d from %s: %m
\n
"
,
lineno
,
filename
);
pg_fatal
(
"could not read line %d from file
\"
%s
\"
: %s
\n
"
,
lineno
,
filename
,
strerror
(
errno
));
/* potentially overwrite user-supplied value */
/* potentially overwrite user-supplied value */
if
(
lineno
==
LOCK_FILE_LINE_PORT
)
if
(
lineno
==
LOCK_FILE_LINE_PORT
)
...
@@ -501,7 +503,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
...
@@ -501,7 +503,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
/* warn of port number correction */
/* warn of port number correction */
if
(
orig_port
!=
DEF_PGUPORT
&&
old_cluster
.
port
!=
orig_port
)
if
(
orig_port
!=
DEF_PGUPORT
&&
old_cluster
.
port
!=
orig_port
)
pg_log
(
PG_WARNING
,
"
U
ser-supplied old port number %hu corrected to %hu
\n
"
,
pg_log
(
PG_WARNING
,
"
u
ser-supplied old port number %hu corrected to %hu
\n
"
,
orig_port
,
cluster
->
port
);
orig_port
,
cluster
->
port
);
}
}
}
}
...
...
src/bin/pg_upgrade/pg_upgrade.c
View file @
c824c7e2
...
@@ -261,7 +261,7 @@ prepare_new_cluster(void)
...
@@ -261,7 +261,7 @@ prepare_new_cluster(void)
* datfrozenxid, relfrozenxids, and relminmxid later to match the new xid
* datfrozenxid, relfrozenxids, and relminmxid later to match the new xid
* counter later.
* counter later.
*/
*/
prep_status
(
"Freezing all rows
o
n the new cluster"
);
prep_status
(
"Freezing all rows
i
n the new cluster"
);
exec_prog
(
UTILITY_LOG_FILE
,
NULL
,
true
,
exec_prog
(
UTILITY_LOG_FILE
,
NULL
,
true
,
"
\"
%s/vacuumdb
\"
%s --all --freeze %s"
,
"
\"
%s/vacuumdb
\"
%s --all --freeze %s"
,
new_cluster
.
bindir
,
cluster_conn_opts
(
&
new_cluster
),
new_cluster
.
bindir
,
cluster_conn_opts
(
&
new_cluster
),
...
@@ -471,7 +471,7 @@ copy_xact_xlog_xid(void)
...
@@ -471,7 +471,7 @@ copy_xact_xlog_xid(void)
*/
*/
remove_new_subdir
(
"pg_multixact/offsets"
,
false
);
remove_new_subdir
(
"pg_multixact/offsets"
,
false
);
prep_status
(
"Setting oldest multixact ID
o
n new cluster"
);
prep_status
(
"Setting oldest multixact ID
i
n new cluster"
);
/*
/*
* We don't preserve files in this case, but it's important that the
* We don't preserve files in this case, but it's important that the
...
...
src/bin/pg_upgrade/server.c
View file @
c824c7e2
...
@@ -167,7 +167,7 @@ get_major_server_version(ClusterInfo *cluster)
...
@@ -167,7 +167,7 @@ get_major_server_version(ClusterInfo *cluster)
if
(
fscanf
(
version_fd
,
"%63s"
,
cluster
->
major_version_str
)
==
0
||
if
(
fscanf
(
version_fd
,
"%63s"
,
cluster
->
major_version_str
)
==
0
||
sscanf
(
cluster
->
major_version_str
,
"%d.%d"
,
&
integer_version
,
sscanf
(
cluster
->
major_version_str
,
"%d.%d"
,
&
integer_version
,
&
fractional_version
)
<
1
)
&
fractional_version
)
<
1
)
pg_fatal
(
"could not
get version
from %s
\n
"
,
cluster
->
pgdata
);
pg_fatal
(
"could not
parse PG_VERSION file
from %s
\n
"
,
cluster
->
pgdata
);
fclose
(
version_fd
);
fclose
(
version_fd
);
...
...
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