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
7e046e6e
Commit
7e046e6e
authored
Aug 22, 2017
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_upgrade: Message translatability and style fixes
parent
b5664cfd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
24 deletions
+30
-24
src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/check.c
+13
-11
src/bin/pg_upgrade/exec.c
src/bin/pg_upgrade/exec.c
+2
-2
src/bin/pg_upgrade/function.c
src/bin/pg_upgrade/function.c
+1
-1
src/bin/pg_upgrade/pg_upgrade.c
src/bin/pg_upgrade/pg_upgrade.c
+8
-4
src/bin/pg_upgrade/server.c
src/bin/pg_upgrade/server.c
+3
-3
src/bin/pg_upgrade/version.c
src/bin/pg_upgrade/version.c
+3
-3
No files found.
src/bin/pg_upgrade/check.c
View file @
7e046e6e
...
@@ -62,13 +62,15 @@ output_check_banner(bool live_check)
...
@@ -62,13 +62,15 @@ output_check_banner(bool live_check)
{
{
if
(
user_opts
.
check
&&
live_check
)
if
(
user_opts
.
check
&&
live_check
)
{
{
pg_log
(
PG_REPORT
,
"Performing Consistency Checks on Old Live Server
\n
"
);
pg_log
(
PG_REPORT
,
pg_log
(
PG_REPORT
,
"------------------------------------------------
\n
"
);
"Performing Consistency Checks on Old Live Server
\n
"
"------------------------------------------------
\n
"
);
}
}
else
else
{
{
pg_log
(
PG_REPORT
,
"Performing Consistency Checks
\n
"
);
pg_log
(
PG_REPORT
,
pg_log
(
PG_REPORT
,
"-----------------------------
\n
"
);
"Performing Consistency Checks
\n
"
"-----------------------------
\n
"
);
}
}
}
}
...
@@ -991,7 +993,7 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
...
@@ -991,7 +993,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
JSONB user data types
"
);
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"
);
...
@@ -1057,8 +1059,8 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
...
@@ -1057,8 +1059,8 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
if
(
found
)
if
(
found
)
{
{
pg_log
(
PG_REPORT
,
"fatal
\n
"
);
pg_log
(
PG_REPORT
,
"fatal
\n
"
);
pg_fatal
(
"Your installation contains
one of the JSONB data types
in user tables.
\n
"
pg_fatal
(
"Your installation contains
the
\"
jsonb
\"
data type
in user tables.
\n
"
"The internal format of
JSONB
changed during 9.4 beta so this cluster cannot currently
\n
"
"The internal format of
\"
jsonb
\"
changed during 9.4 beta so this cluster cannot currently
\n
"
"be upgraded. You can remove the problem tables and restart the upgrade. A list
\n
"
"be upgraded. You can remove the problem tables and restart the upgrade. A list
\n
"
"of the problem columns is in the file:
\n
"
"of the problem columns is in the file:
\n
"
" %s
\n\n
"
,
output_path
);
" %s
\n\n
"
,
output_path
);
...
@@ -1078,7 +1080,7 @@ check_for_pg_role_prefix(ClusterInfo *cluster)
...
@@ -1078,7 +1080,7 @@ check_for_pg_role_prefix(ClusterInfo *cluster)
PGresult
*
res
;
PGresult
*
res
;
PGconn
*
conn
=
connectToServer
(
cluster
,
"template1"
);
PGconn
*
conn
=
connectToServer
(
cluster
,
"template1"
);
prep_status
(
"Checking for roles starting with
'pg_'
"
);
prep_status
(
"Checking for roles starting with
\"
pg_
\"
"
);
res
=
executeQueryOrDie
(
conn
,
res
=
executeQueryOrDie
(
conn
,
"SELECT * "
"SELECT * "
...
@@ -1088,9 +1090,9 @@ check_for_pg_role_prefix(ClusterInfo *cluster)
...
@@ -1088,9 +1090,9 @@ check_for_pg_role_prefix(ClusterInfo *cluster)
if
(
PQntuples
(
res
)
!=
0
)
if
(
PQntuples
(
res
)
!=
0
)
{
{
if
(
cluster
==
&
old_cluster
)
if
(
cluster
==
&
old_cluster
)
pg_fatal
(
"The source cluster contains roles starting with
'pg_'
\n
"
);
pg_fatal
(
"The source cluster contains roles starting with
\"
pg_
\"
\n
"
);
else
else
pg_fatal
(
"The target cluster contains roles starting with
'pg_'
\n
"
);
pg_fatal
(
"The target cluster contains roles starting with
\"
pg_
\"
\n
"
);
}
}
PQclear
(
res
);
PQclear
(
res
);
...
...
src/bin/pg_upgrade/exec.c
View file @
7e046e6e
...
@@ -307,7 +307,7 @@ check_single_dir(const char *pg_data, const char *subdir)
...
@@ -307,7 +307,7 @@ check_single_dir(const char *pg_data, const char *subdir)
report_status
(
PG_FATAL
,
"check for
\"
%s
\"
failed: %s
\n
"
,
report_status
(
PG_FATAL
,
"check for
\"
%s
\"
failed: %s
\n
"
,
subDirName
,
strerror
(
errno
));
subDirName
,
strerror
(
errno
));
else
if
(
!
S_ISDIR
(
statBuf
.
st_mode
))
else
if
(
!
S_ISDIR
(
statBuf
.
st_mode
))
report_status
(
PG_FATAL
,
"
%s
is not a directory
\n
"
,
report_status
(
PG_FATAL
,
"
\"
%s
\"
is not a directory
\n
"
,
subDirName
);
subDirName
);
}
}
...
@@ -370,7 +370,7 @@ check_bin_dir(ClusterInfo *cluster)
...
@@ -370,7 +370,7 @@ check_bin_dir(ClusterInfo *cluster)
report_status
(
PG_FATAL
,
"check for
\"
%s
\"
failed: %s
\n
"
,
report_status
(
PG_FATAL
,
"check for
\"
%s
\"
failed: %s
\n
"
,
cluster
->
bindir
,
strerror
(
errno
));
cluster
->
bindir
,
strerror
(
errno
));
else
if
(
!
S_ISDIR
(
statBuf
.
st_mode
))
else
if
(
!
S_ISDIR
(
statBuf
.
st_mode
))
report_status
(
PG_FATAL
,
"
%s
is not a directory
\n
"
,
report_status
(
PG_FATAL
,
"
\"
%s
\"
is not a directory
\n
"
,
cluster
->
bindir
);
cluster
->
bindir
);
validate_exec
(
cluster
->
bindir
,
"postgres"
);
validate_exec
(
cluster
->
bindir
,
"postgres"
);
...
...
src/bin/pg_upgrade/function.c
View file @
7e046e6e
...
@@ -252,7 +252,7 @@ check_loadable_libraries(void)
...
@@ -252,7 +252,7 @@ check_loadable_libraries(void)
if
(
script
==
NULL
&&
(
script
=
fopen_priv
(
output_path
,
"w"
))
==
NULL
)
if
(
script
==
NULL
&&
(
script
=
fopen_priv
(
output_path
,
"w"
))
==
NULL
)
pg_fatal
(
"could not open file
\"
%s
\"
: %s
\n
"
,
pg_fatal
(
"could not open file
\"
%s
\"
: %s
\n
"
,
output_path
,
strerror
(
errno
));
output_path
,
strerror
(
errno
));
fprintf
(
script
,
_
(
"could not load library
\"
%s
\"
:
\n
%s
\n
"
),
fprintf
(
script
,
_
(
"could not load library
\"
%s
\"
:
%s
"
),
lib
,
lib
,
PQerrorMessage
(
conn
));
PQerrorMessage
(
conn
));
}
}
...
...
src/bin/pg_upgrade/pg_upgrade.c
View file @
7e046e6e
...
@@ -104,8 +104,10 @@ main(int argc, char **argv)
...
@@ -104,8 +104,10 @@ main(int argc, char **argv)
check_new_cluster
();
check_new_cluster
();
report_clusters_compatible
();
report_clusters_compatible
();
pg_log
(
PG_REPORT
,
"
\n
Performing Upgrade
\n
"
);
pg_log
(
PG_REPORT
,
pg_log
(
PG_REPORT
,
"------------------
\n
"
);
"
\n
"
"Performing Upgrade
\n
"
"------------------
\n
"
);
prepare_new_cluster
();
prepare_new_cluster
();
...
@@ -164,8 +166,10 @@ main(int argc, char **argv)
...
@@ -164,8 +166,10 @@ main(int argc, char **argv)
issue_warnings_and_set_wal_level
();
issue_warnings_and_set_wal_level
();
pg_log
(
PG_REPORT
,
"
\n
Upgrade Complete
\n
"
);
pg_log
(
PG_REPORT
,
pg_log
(
PG_REPORT
,
"----------------
\n
"
);
"
\n
"
"Upgrade Complete
\n
"
"----------------
\n
"
);
output_completion_banner
(
analyze_script_file_name
,
output_completion_banner
(
analyze_script_file_name
,
deletion_script_file_name
);
deletion_script_file_name
);
...
...
src/bin/pg_upgrade/server.c
View file @
7e046e6e
...
@@ -30,7 +30,7 @@ connectToServer(ClusterInfo *cluster, const char *db_name)
...
@@ -30,7 +30,7 @@ connectToServer(ClusterInfo *cluster, const char *db_name)
if
(
conn
==
NULL
||
PQstatus
(
conn
)
!=
CONNECTION_OK
)
if
(
conn
==
NULL
||
PQstatus
(
conn
)
!=
CONNECTION_OK
)
{
{
pg_log
(
PG_REPORT
,
"connection to database failed: %s
\n
"
,
pg_log
(
PG_REPORT
,
"connection to database failed: %s"
,
PQerrorMessage
(
conn
));
PQerrorMessage
(
conn
));
if
(
conn
)
if
(
conn
)
...
@@ -132,7 +132,7 @@ executeQueryOrDie(PGconn *conn, const char *fmt,...)
...
@@ -132,7 +132,7 @@ executeQueryOrDie(PGconn *conn, const char *fmt,...)
if
((
status
!=
PGRES_TUPLES_OK
)
&&
(
status
!=
PGRES_COMMAND_OK
))
if
((
status
!=
PGRES_TUPLES_OK
)
&&
(
status
!=
PGRES_COMMAND_OK
))
{
{
pg_log
(
PG_REPORT
,
"SQL command failed
\n
%s
\n
%s
\n
"
,
query
,
pg_log
(
PG_REPORT
,
"SQL command failed
\n
%s
\n
%s"
,
query
,
PQerrorMessage
(
conn
));
PQerrorMessage
(
conn
));
PQclear
(
result
);
PQclear
(
result
);
PQfinish
(
conn
);
PQfinish
(
conn
);
...
@@ -281,7 +281,7 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
...
@@ -281,7 +281,7 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
if
((
conn
=
get_db_conn
(
cluster
,
"template1"
))
==
NULL
||
if
((
conn
=
get_db_conn
(
cluster
,
"template1"
))
==
NULL
||
PQstatus
(
conn
)
!=
CONNECTION_OK
)
PQstatus
(
conn
)
!=
CONNECTION_OK
)
{
{
pg_log
(
PG_REPORT
,
"
\n
connection to database failed: %s
\n
"
,
pg_log
(
PG_REPORT
,
"
\n
connection to database failed: %s"
,
PQerrorMessage
(
conn
));
PQerrorMessage
(
conn
));
if
(
conn
)
if
(
conn
)
PQfinish
(
conn
);
PQfinish
(
conn
);
...
...
src/bin/pg_upgrade/version.c
View file @
7e046e6e
...
@@ -82,7 +82,7 @@ new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster, bool check_mode)
...
@@ -82,7 +82,7 @@ new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster, bool check_mode)
pg_log
(
PG_WARNING
,
"
\n
"
pg_log
(
PG_WARNING
,
"
\n
"
"Your installation contains large objects. The new database has an
\n
"
"Your installation contains large objects. The new database has an
\n
"
"additional large object permission table. After upgrading, you will be
\n
"
"additional large object permission table. After upgrading, you will be
\n
"
"given a command to populate the pg_largeobject
permission
table with
\n
"
"given a command to populate the pg_largeobject
_metadata
table with
\n
"
"default permissions.
\n\n
"
);
"default permissions.
\n\n
"
);
else
else
pg_log
(
PG_WARNING
,
"
\n
"
pg_log
(
PG_WARNING
,
"
\n
"
...
@@ -115,7 +115,7 @@ old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster)
...
@@ -115,7 +115,7 @@ old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster)
bool
found
=
false
;
bool
found
=
false
;
char
output_path
[
MAXPGPATH
];
char
output_path
[
MAXPGPATH
];
prep_status
(
"Checking for in
valid
\"
line
\"
user columns
"
);
prep_status
(
"Checking for in
compatible
\"
line
\"
data type
"
);
snprintf
(
output_path
,
sizeof
(
output_path
),
"tables_using_line.txt"
);
snprintf
(
output_path
,
sizeof
(
output_path
),
"tables_using_line.txt"
);
...
@@ -390,7 +390,7 @@ old_9_6_invalidate_hash_indexes(ClusterInfo *cluster, bool check_mode)
...
@@ -390,7 +390,7 @@ old_9_6_invalidate_hash_indexes(ClusterInfo *cluster, bool check_mode)
pg_log
(
PG_WARNING
,
"
\n
"
pg_log
(
PG_WARNING
,
"
\n
"
"Your installation contains hash indexes. These indexes have different
\n
"
"Your installation contains hash indexes. These indexes have different
\n
"
"internal formats between your old and new clusters, so they must be
\n
"
"internal formats between your old and new clusters, so they must be
\n
"
"reindexed with the REINDEX command. The file
:
\n
"
"reindexed with the REINDEX command. The file
\n
"
" %s
\n
"
" %s
\n
"
"when executed by psql by the database superuser will recreate all invalid
\n
"
"when executed by psql by the database superuser will recreate all invalid
\n
"
"indexes; until then, none of these indexes will be used.
\n\n
"
,
"indexes; until then, none of these indexes will be used.
\n\n
"
,
...
...
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