Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file

Поиск
Список
Период
Сортировка
От ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Тема Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file
Дата
Msg-id 87k149w673.fsf@wibble.ilmari.org
обсуждение исходный текст
Ответ на Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCH] pg_upgrade: report the reason for failing to open thecluster version file  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
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

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: Error on failed COMMIT
Следующее
От: "Haumacher, Bernhard"
Дата:
Сообщение: Re: Error on failed COMMIT