Re: Small fixes for incorrect error messages

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: zengman <zengman@halodbtech.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Date: 2026-02-07T08:57:20Z
Lists: pgsql-hackers
On 05.02.26 07:51, zengman wrote:
> ```
>   	if (fstat(fd, &statbuf) < 0)
> -		pg_fatal("could not open file \"%s\" for reading: %m",
> +		pg_fatal("could not stat file \"%s\" for reading: %m",
>   				 fullpath);
> ```

It doesn't make sense to "stat a file for reading".  The changed message 
should probably just be

 > +		pg_fatal("could not stat file \"%s\": %m",
 >   				 fullpath);




Commits

  1. Further error message fix

  2. Fix some error message inconsistencies