Re: Error logging messages

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Subject: Re: Error logging messages
Date: 2022-04-14 08:21:34
Message-ID: B51DCE94-F646-4F69-A988-D45D0AFBA482@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 14 Apr 2022, at 09:10, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Wed, Apr 13, 2022 at 01:51:16PM +0200, Daniel Gustafsson wrote:
>> 0001: Makes sure that database and file names are printed quoted. This patch
>> has hunks in contrib and backend as well.
>>
>> 0002: Capitalizes pg_log_error_detail and conversely starts pg_log_error with a
>> lowercase letter without punctuation.
>>
>> 0003: Extend a few messages with more information to be more consistent with
>> other messages (and more helpful).
>>
>> 0005: Put keywords as parameters in a few pg_dump error messages, to make their
>> translations reuseable.
>
> These look fine.

Thanks

>> 0004: Add pg_log_error() calls on all calls to close in pg_basebackup. Nearly
>> all had already, and while errors here are likely to be rare, when they do
>> happen something is really wrong and every bit of information can help
>> debugging.
>
> + if (stream->walmethod->close(f, CLOSE_UNLINK) != 0)
> + pg_log_error("could not delete write-ahead log file \"%s\": %s",
> + fn, stream->walmethod->getlasterror());
> With only the file names provided, it is possible to know that this is
> a WAL file. Could we switch to a simpler "could not delete file
> \"%s\"" instead? Same comment for the history file and the fsync
> failure a couple of lines above.

I don't have strong opinions, simplifying makes it easier on translators (due
to reuse) and keeping the verbose message may make it easier for users
experiencing problems.

--
Daniel Gustafsson https://vmware.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2022-04-14 08:22:59 Re: Handle infinite recursion in logical replication setup
Previous Message Shinya Kato 2022-04-14 07:42:39 Re: Add --{no-,}bypassrls flags to createuser