Re: Error logging messages

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
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 07:10:19
Message-ID: YlfI284hefPB1dhj@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

> 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.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shinya Kato 2022-04-14 07:42:39 Re: Add --{no-,}bypassrls flags to createuser
Previous Message Richard Guo 2022-04-14 06:49:23 Use outerPlanState macro instead of referring to leffttree