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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] pg_upgrade: report the reason for failing to open thecluster version file
Дата
Msg-id 20200226014844.GF17153@paquier.xyz
обсуждение исходный текст
Ответ на 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 thecluster version file  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
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.

>      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 PG_VERSION file from \"%s\"\n", cluster->pgdata);
>
>      fclose(version_fd);

No objection to this one.
--
Michael

Вложения

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

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: [Proposal] Add accumulated statistics for wait event
Следующее
От: yuzuko
Дата:
Сообщение: Re: Autovacuum on partitioned table