pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ilmari@ilmari.org
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file
Date: Wed, 26 Feb 2020 18:32:00 +0000
Message-ID: <87k149w673.fsf@wibble.ilmari.org> (raw)
In-Reply-To: <9878.1582732525@sss.pgh.pa.us>
References: <87pne2w98h.fsf@wibble.ilmari.org>
	<44115C15-EE49-4BDE-A976-2901384B5E60@yesql.se>
	<87mu96w7c5.fsf@wibble.ilmari.org>
	<20200226014844.GF17153@paquier.xyz>
	<2760811A-9AF4-4725-8A8A-061940CCF962@yesql.se>
	<CABUevEygyP_o9LmEWbSGzP3Wu-sstGSrQE9kq_WpuOEy1FOm5g@mail.gmail.com>
	<20200226093551.GA106669@paquier.xyz>
	<9878.1582732525@sss.pgh.pa.us>

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.

- ilmari
-- 
- Twitter seems more influential [than blogs] in the 'gets reported in
  the mainstream press' sense at least.               - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
  to a mainstream media article.                      - Calle Dybedahl

Attachments:

0001-Make-pg_upgrade-s-version-file-parsing-error-message.patch (text/x-diff, 910B) download From a761148357420fdf81589e28df701cc1fde4cb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org> Date: Wed, 26 Feb 2020 18:29:03 +0000 Subject: [PATCH] Make pg_upgrade's version file parsing error message consistent --- src/bin/pg_upgrade/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c index be604d3351..f669bb4e8a 100644 --- a/src/bin/pg_upgrade/server.c +++ b/src/bin/pg_upgrade/server.c @@ -168,7 +168,7 @@ get_major_server_version(ClusterInfo *cluster) if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 || sscanf(cluster->major_version_str, "%d.%d", &v1, &v2) < 1) - pg_fatal("could not parse PG_VERSION file from \"%s\"\n", cluster->pgdata); + pg_fatal("could not parse version file \"%s\"\n", ver_filename); fclose(version_fd); -- 2.20.1

view thread (11+ messages)  latest in thread

Message-ID: <87k149w673.fsf@wibble.ilmari.org>
Permalink:  ../87k149w673.fsf@wibble.ilmari.org/
Also on:    postgresql.org/message-id/87k149w673.fsf@wibble.ilmari.org

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ilmari@ilmari.org, tgl@sss.pgh.pa.us, michael@paquier.xyz, magnus@hagander.net, daniel@yesql.se, pgsql-hackers@lists.postgresql.org
  Subject: Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file
  In-Reply-To: <87k149w673.fsf@wibble.ilmari.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox