From a9701a1d7df8c7a088ed7c37316fe4118a507015 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 10 Oct 2012 13:53:00 -0400 Subject: [PATCH] In pg_upgrade, issue proper error message when we can't open PG_VERSION. Backpatch to 9.2. --- contrib/pg_upgrade/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c index 11e7e75d78..a9f9d85b78 100644 --- a/contrib/pg_upgrade/server.c +++ b/contrib/pg_upgrade/server.c @@ -149,7 +149,7 @@ 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) - return 0; + pg_log(PG_FATAL, "could not open version file: %s\n", ver_filename); if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 || sscanf(cluster->major_version_str, "%d.%d", &integer_version, -- 2.40.0