From 4109bb5de4998b9301ea2ac18c9d6dfb0b4f900b Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 26 Feb 2020 10:03:11 +0100 Subject: [PATCH] Include error code in message from pg_upgrade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In passing, also quote the filename in one message where it wasn't. Author: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/87pne2w98h.fsf@wibble.ilmari.org --- src/bin/pg_upgrade/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c index e2442565013..be604d33514 100644 --- a/src/bin/pg_upgrade/server.c +++ b/src/bin/pg_upgrade/server.c @@ -164,11 +164,11 @@ get_major_server_version(ClusterInfo *cluster) snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION", cluster->pgdata); if ((version_fd = fopen(ver_filename, "r")) == NULL) - pg_fatal("could not open version file: %s\n", ver_filename); + pg_fatal("could not open version file \"%s\": %m\n", ver_filename); if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 || sscanf(cluster->major_version_str, "%d.%d", &v1, &v2) < 1) - pg_fatal("could not parse PG_VERSION file from %s\n", cluster->pgdata); + pg_fatal("could not parse PG_VERSION file from \"%s\"\n", cluster->pgdata); fclose(version_fd);