Skip to content

Commit 4109bb5

Browse files
committed
Include error code in message from pg_upgrade
In passing, also quote the filename in one message where it wasn't. Author: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/[email protected]
1 parent 59f9cd9 commit 4109bb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pg_upgrade/server.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ get_major_server_version(ClusterInfo *cluster)
164164
snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION",
165165
cluster->pgdata);
166166
if ((version_fd = fopen(ver_filename, "r")) == NULL)
167-
pg_fatal("could not open version file: %s\n", ver_filename);
167+
pg_fatal("could not open version file \"%s\": %m\n", ver_filename);
168168

169169
if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
170170
sscanf(cluster->major_version_str, "%d.%d", &v1, &v2) < 1)
171-
pg_fatal("could not parse PG_VERSION file from %s\n", cluster->pgdata);
171+
pg_fatal("could not parse PG_VERSION file from \"%s\"\n", cluster->pgdata);
172172

173173
fclose(version_fd);
174174

0 commit comments

Comments
 (0)