Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c824c7e

Browse files
committed
pg_upgrade: Message style fixes
1 parent fdf87ed commit c824c7e

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

src/bin/pg_upgrade/check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
987987
bool found = false;
988988
char output_path[MAXPGPATH];
989989

990-
prep_status("Checking for incompatible jsonb data type");
990+
prep_status("Checking for incompatible \"jsonb\" data type");
991991

992992
snprintf(output_path, sizeof(output_path), "tables_using_jsonb.txt");
993993

src/bin/pg_upgrade/exec.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ get_bin_version(ClusterInfo *cluster)
5151
*strchr(cmd_output, '\n') = '\0';
5252

5353
if (sscanf(cmd_output, "%*s %*s %d.%d", &pre_dot, &post_dot) < 1)
54-
pg_fatal("could not get version from %s\n", cmd);
54+
pg_fatal("could not get pg_ctl version output from %s\n", cmd);
5555

5656
cluster->bin_version = (pre_dot * 100 + post_dot) * 100;
5757
}
@@ -143,7 +143,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
143143
#endif
144144

145145
if (log == NULL)
146-
pg_fatal("cannot write to log file %s\n", log_file);
146+
pg_fatal("could not write to log file \"%s\"\n", log_file);
147147

148148
#ifdef WIN32
149149
/* Are we printing "command:" before its output? */
@@ -198,7 +198,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
198198
* log these commands to a third file, but that just adds complexity.
199199
*/
200200
if ((log = fopen(log_file, "a")) == NULL)
201-
pg_fatal("cannot write to log file %s\n", log_file);
201+
pg_fatal("could not write to log file \"%s\"\n", log_file);
202202
fprintf(log, "\n\n");
203203
fclose(log);
204204
#endif
@@ -426,7 +426,7 @@ validate_exec(const char *dir, const char *cmdName)
426426
pg_fatal("check for \"%s\" failed: %s\n",
427427
path, strerror(errno));
428428
else if (!S_ISREG(buf.st_mode))
429-
pg_fatal("check for \"%s\" failed: not an executable file\n",
429+
pg_fatal("check for \"%s\" failed: not a regular file\n",
430430
path);
431431

432432
/*

src/bin/pg_upgrade/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ check_hard_link(void)
290290

291291
if (pg_link_file(existing_file, new_link_file) < 0)
292292
pg_fatal("could not create hard link between old and new data directories: %s\n"
293-
"In link mode the old and new data directories must be on the same file system volume.\n",
293+
"In link mode the old and new data directories must be on the same file system.\n",
294294
strerror(errno));
295295

296296
unlink(new_link_file);

src/bin/pg_upgrade/option.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ parseCommandLine(int argc, char *argv[])
9898
pg_fatal("%s: cannot be run as root\n", os_info.progname);
9999

100100
if ((log_opts.internal = fopen_priv(INTERNAL_LOG_FILE, "a")) == NULL)
101-
pg_fatal("cannot write to log file %s\n", INTERNAL_LOG_FILE);
101+
pg_fatal("could not write to log file \"%s\"\n", INTERNAL_LOG_FILE);
102102

103103
while ((option = getopt_long(argc, argv, "d:D:b:B:cj:ko:O:p:P:rU:v",
104104
long_options, &optindex)) != -1)
@@ -214,7 +214,7 @@ parseCommandLine(int argc, char *argv[])
214214
for (filename = output_files; *filename != NULL; filename++)
215215
{
216216
if ((fp = fopen_priv(*filename, "a")) == NULL)
217-
pg_fatal("cannot write to log file %s\n", *filename);
217+
pg_fatal("could not write to log file \"%s\"\n", *filename);
218218

219219
/* Start with newline because we might be appending to a file. */
220220
fprintf(fp, "\n"
@@ -262,7 +262,7 @@ parseCommandLine(int argc, char *argv[])
262262
canonicalize_path(new_cluster_pgdata);
263263

264264
if (!getcwd(cwd, MAXPGPATH))
265-
pg_fatal("cannot find current directory\n");
265+
pg_fatal("could not determine current directory\n");
266266
canonicalize_path(cwd);
267267
if (path_is_prefix_of_path(new_cluster_pgdata, cwd))
268268
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)
459459
/* Use the current directory for the socket */
460460
cluster->sockdir = pg_malloc(MAXPGPATH);
461461
if (!getcwd(cluster->sockdir, MAXPGPATH))
462-
pg_fatal("cannot find current directory\n");
462+
pg_fatal("could not determine current directory\n");
463463
}
464464
else
465465
{
@@ -477,14 +477,16 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
477477
snprintf(filename, sizeof(filename), "%s/postmaster.pid",
478478
cluster->pgdata);
479479
if ((fp = fopen(filename, "r")) == NULL)
480-
pg_fatal("Cannot open file %s: %m\n", filename);
480+
pg_fatal("could not open file \"%s\": %s\n",
481+
filename, strerror(errno));
481482

482483
for (lineno = 1;
483484
lineno <= Max(LOCK_FILE_LINE_PORT, LOCK_FILE_LINE_SOCKET_DIR);
484485
lineno++)
485486
{
486487
if (fgets(line, sizeof(line), fp) == NULL)
487-
pg_fatal("Cannot read line %d from %s: %m\n", lineno, filename);
488+
pg_fatal("could not read line %d from file \"%s\": %s\n",
489+
lineno, filename, strerror(errno));
488490

489491
/* potentially overwrite user-supplied value */
490492
if (lineno == LOCK_FILE_LINE_PORT)
@@ -501,7 +503,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
501503

502504
/* warn of port number correction */
503505
if (orig_port != DEF_PGUPORT && old_cluster.port != orig_port)
504-
pg_log(PG_WARNING, "User-supplied old port number %hu corrected to %hu\n",
506+
pg_log(PG_WARNING, "user-supplied old port number %hu corrected to %hu\n",
505507
orig_port, cluster->port);
506508
}
507509
}

src/bin/pg_upgrade/pg_upgrade.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ prepare_new_cluster(void)
261261
* datfrozenxid, relfrozenxids, and relminmxid later to match the new xid
262262
* counter later.
263263
*/
264-
prep_status("Freezing all rows on the new cluster");
264+
prep_status("Freezing all rows in the new cluster");
265265
exec_prog(UTILITY_LOG_FILE, NULL, true,
266266
"\"%s/vacuumdb\" %s --all --freeze %s",
267267
new_cluster.bindir, cluster_conn_opts(&new_cluster),
@@ -471,7 +471,7 @@ copy_xact_xlog_xid(void)
471471
*/
472472
remove_new_subdir("pg_multixact/offsets", false);
473473

474-
prep_status("Setting oldest multixact ID on new cluster");
474+
prep_status("Setting oldest multixact ID in new cluster");
475475

476476
/*
477477
* We don't preserve files in this case, but it's important that the

src/bin/pg_upgrade/server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ get_major_server_version(ClusterInfo *cluster)
167167
if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
168168
sscanf(cluster->major_version_str, "%d.%d", &integer_version,
169169
&fractional_version) < 1)
170-
pg_fatal("could not get version from %s\n", cluster->pgdata);
170+
pg_fatal("could not parse PG_VERSION file from %s\n", cluster->pgdata);
171171

172172
fclose(version_fd);
173173

0 commit comments

Comments
 (0)