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

From Bruce Momjian
Subject Re: [PATCH] pg_upgrade: report the reason for failing to open thecluster version file
Date
Msg-id 20200319192304.GA28431@momjian.us
Whole thread Raw
In response to Re: [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  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
List pgsql-hackers
On Wed, Feb 26, 2020 at 06:32:00PM +0000, Dagfinn Ilmari Mannsåker wrote:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
> 
> > Michael Paquier <michael@paquier.xyz> writes:
> >> On Wed, Feb 26, 2020 at 10:06:38AM +0100, Magnus Hagander wrote:
> >>> +1, seems like that would be a regression in value.
> >
> >> Having more generic messages is less work for translators, we have
> >> PG_VERSION in the file name, and that's more complicated to translate
> >> in both French and Japanese.  No idea about other languages.
> >
> > Just looking at the committed diff, it seems painfully obvious that these
> > two messages were written by different people who weren't talking to each
> > other.  Why aren't they more alike?  Given
> >
> >        pg_fatal("could not open version file \"%s\": %m\n", ver_filename);
> >
> > (which seems fine to me), I think the second ought to be
> >
> >        pg_fatal("could not parse version file \"%s\"\n", ver_filename);
> 
> Good point.  Patch attached.

Patch applied, and other adjustments:

    This patch fixes the error message in get_major_server_version()
    to be "could not parse version file", and uses the full file path
    name, rather than just the data directory path.

    Also, commit 4109bb5de4 added the cause of the failure to the
    "could not open" error message, and improved quoting.  This patch
    backpatches the "could not open" cause to PG 12, where it was
    first widely used, and backpatches the quoting fix in that patch
    to all supported releases.

Because some of the branches are different, I am attaching the applied
multi-version patch.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +

Attachment

pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: GSoC applicant proposal, Uday PB
Next
From: Jeff Davis
Date:
Subject: Re: Make MemoryContextMemAllocated() more precise