Commit c824c7e2 authored by Peter Eisentraut's avatar Peter Eisentraut

pg_upgrade: Message style fixes

parent fdf87ed4
......@@ -987,7 +987,7 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
bool found = false;
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");
......
......@@ -51,7 +51,7 @@ get_bin_version(ClusterInfo *cluster)
*strchr(cmd_output, '\n') = '\0';
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;
}
......@@ -143,7 +143,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
#endif
if (log == NULL)
pg_fatal("cannot write to log file %s\n", log_file);
pg_fatal("could not write to log file \"%s\"\n", log_file);
#ifdef WIN32
/* Are we printing "command:" before its output? */
......@@ -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.
*/
if ((log = fopen(log_file, "a")) == NULL)
pg_fatal("cannot write to log file %s\n", log_file);
pg_fatal("could not write to log file \"%s\"\n", log_file);
fprintf(log, "\n\n");
fclose(log);
#endif
......@@ -426,7 +426,7 @@ validate_exec(const char *dir, const char *cmdName)
pg_fatal("check for \"%s\" failed: %s\n",
path, strerror(errno));
else if (!S_ISREG(buf.st_mode))
pg_fatal("check for \"%s\" failed: not an executable file\n",
pg_fatal("check for \"%s\" failed: not a regular file\n",
path);
/*
......
......@@ -290,7 +290,7 @@ check_hard_link(void)
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"
"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));
unlink(new_link_file);
......
......@@ -98,7 +98,7 @@ parseCommandLine(int argc, char *argv[])
pg_fatal("%s: cannot be run as root\n", os_info.progname);
if ((log_opts.internal = fopen_priv(INTERNAL_LOG_FILE, "a")) == NULL)
pg_fatal("cannot write to log file %s\n", INTERNAL_LOG_FILE);
pg_fatal("could 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",
long_options, &optindex)) != -1)
......@@ -214,7 +214,7 @@ parseCommandLine(int argc, char *argv[])
for (filename = output_files; *filename != NULL; filename++)
{
if ((fp = fopen_priv(*filename, "a")) == NULL)
pg_fatal("cannot write to log file %s\n", *filename);
pg_fatal("could not write to log file \"%s\"\n", *filename);
/* Start with newline because we might be appending to a file. */
fprintf(fp, "\n"
......@@ -262,7 +262,7 @@ parseCommandLine(int argc, char *argv[])
canonicalize_path(new_cluster_pgdata);
if (!getcwd(cwd, MAXPGPATH))
pg_fatal("cannot find current directory\n");
pg_fatal("could not determine current directory\n");
canonicalize_path(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");
......@@ -459,7 +459,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
/* Use the current directory for the socket */
cluster->sockdir = pg_malloc(MAXPGPATH);
if (!getcwd(cluster->sockdir, MAXPGPATH))
pg_fatal("cannot find current directory\n");
pg_fatal("could not determine current directory\n");
}
else
{
......@@ -477,14 +477,16 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
snprintf(filename, sizeof(filename), "%s/postmaster.pid",
cluster->pgdata);
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;
lineno <= Max(LOCK_FILE_LINE_PORT, LOCK_FILE_LINE_SOCKET_DIR);
lineno++)
{
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 */
if (lineno == LOCK_FILE_LINE_PORT)
......@@ -501,7 +503,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
/* warn of port number correction */
if (orig_port != DEF_PGUPORT && old_cluster.port != orig_port)
pg_log(PG_WARNING, "User-supplied old port number %hu corrected to %hu\n",
pg_log(PG_WARNING, "user-supplied old port number %hu corrected to %hu\n",
orig_port, cluster->port);
}
}
......
......@@ -261,7 +261,7 @@ prepare_new_cluster(void)
* datfrozenxid, relfrozenxids, and relminmxid later to match the new xid
* counter later.
*/
prep_status("Freezing all rows on the new cluster");
prep_status("Freezing all rows in the new cluster");
exec_prog(UTILITY_LOG_FILE, NULL, true,
"\"%s/vacuumdb\" %s --all --freeze %s",
new_cluster.bindir, cluster_conn_opts(&new_cluster),
......@@ -471,7 +471,7 @@ copy_xact_xlog_xid(void)
*/
remove_new_subdir("pg_multixact/offsets", false);
prep_status("Setting oldest multixact ID on new cluster");
prep_status("Setting oldest multixact ID in new cluster");
/*
* We don't preserve files in this case, but it's important that the
......
......@@ -167,7 +167,7 @@ get_major_server_version(ClusterInfo *cluster)
if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
sscanf(cluster->major_version_str, "%d.%d", &integer_version,
&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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment