Re: Have better wording for snapshot file reading failure - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Have better wording for snapshot file reading failure
Date
Msg-id 8773C5F1-8E60-42F1-850B-E66CC25D7B0A@yesql.se
Whole thread Raw
In response to Re: Have better wording for snapshot file reading failure  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Have better wording for snapshot file reading failure
List pgsql-hackers
> On 13 Sep 2023, at 08:18, Michael Paquier <michael@paquier.xyz> wrote:

>     f = AllocateFile(path, PG_BINARY_R);
>     if (!f)
>         ereport(ERROR,
> -                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> -                 errmsg("invalid snapshot identifier: \"%s\"", idstr)));
> +                (errcode_for_file_access(),
> +                 errmsg("could not open file \"%s\" for reading: %m",
> +                        path)));
>
> Agreed that this just looks like a copy-pasto.  The path provides
> enough context about what's being read, so using this generic error
> message is fine.  Will apply if there are no objections.

+1. This errmsg is already present so it eases the translation burden as well.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Synchronizing slots from primary to standby
Next
From: shveta malik
Date:
Subject: Re: Synchronizing slots from primary to standby