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 44115C15-EE49-4BDE-A976-2901384B5E60@yesql.se
Whole thread Raw
In response to [PATCH] pg_upgrade: report the reason for failing to open the cluster version file  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Responses Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file
List pgsql-hackers
> On 26 Feb 2020, at 00:14, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> wrote:

> It would have saved some minutes of debugging time if that had included
> the reason why the open failed, so here's a patch to do so.

+1 on the attached patch.  A quick skim across the similar error reportings in
pg_upgrade doesn't turn up any others which lack the more detailed information.

> -        pg_fatal("could not open version file: %s\n", ver_filename);
> +        pg_fatal("could not open version file \"%s\": %m\n", ver_filename);

A few lines further down from this we report an error in case we are unable to
parse the file in question:

        pg_fatal("could not parse PG_VERSION file from %s\n", cluster->pgdata);

Should the pgdata argument be quoted there as well, like \"%s\", to make it
consistent for how we report filenames and directories in pg_upgrade?

cheers ./daniel


pgsql-hackers by date:

Previous
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file
Next
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file