1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-02 11:44:50 +03:00

In pg_upgrade, issue proper error message when we can't open PG_VERSION.

Backpatch to 9.2.
This commit is contained in:
Bruce Momjian 2012-10-10 13:53:26 -04:00
parent 1b013f78fb
commit c33d6ef57d

View File

@ -149,7 +149,7 @@ get_major_server_version(ClusterInfo *cluster)
snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION", snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION",
cluster->pgdata); cluster->pgdata);
if ((version_fd = fopen(ver_filename, "r")) == NULL) 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 || if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
sscanf(cluster->major_version_str, "%d.%d", &integer_version, sscanf(cluster->major_version_str, "%d.%d", &integer_version,