Re: [PATCH] pg_upgrade: report the reason for failing to open thecluster version file - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: [PATCH] pg_upgrade: report the reason for failing to open thecluster version file
Date
Msg-id 2760811A-9AF4-4725-8A8A-061940CCF962@yesql.se
Whole thread Raw
In response to Re: [PATCH] pg_upgrade: report the reason for failing to open thecluster version file  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [PATCH] pg_upgrade: report the reason for failing to open thecluster version file
List pgsql-hackers
> On 26 Feb 2020, at 02:48, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Tue, Feb 25, 2020 at 11:55:06PM +0000, Dagfinn Ilmari Mannsåker wrote:
>> @@ -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);
>
> Here I think that it would be better to just use "could not open
> file" as we know that we are dealing with a version file already
> thanks to ver_filename.

Isn't that a removal of detail with very little benefit?  Not everyone running
pg_upgrade will know internal filenames, and the ver_filename contains the
pgdata path as well which might provide additional clues in case this goes
wrong.

cheers ./daniel


pgsql-hackers by date:

Previous
From: Sandro Santilli
Date:
Subject: Re: Marking some contrib modules as trusted extensions
Next
From: Magnus Hagander
Date:
Subject: Re: [PATCH] pg_upgrade: report the reason for failing to open thecluster version file