Re: Log prefix missing for subscriber log messages received from publisher - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Log prefix missing for subscriber log messages received from publisher
Date
Msg-id b7eb8488-2c75-445a-9480-09c630d09673@oss.nttdata.com
Whole thread Raw
In response to Re: Log prefix missing for subscriber log messages received from publisher  (vignesh C <vignesh21@gmail.com>)
Responses Re: Log prefix missing for subscriber log messages received from publisher
List pgsql-hackers

On 2025/07/17 17:05, vignesh C wrote:
> On Thu, 17 Jul 2025 at 11:18, Álvaro Herrera <alvherre@kurilemu.de> wrote:
>>
>> Hi,
>>
>> Shouldn't we be using a notice receiver rather than a notice processor?
> 
> I saw the following comment in code regarding PQsetNoticeProcessor
> should be deprecated:
> /*
>   * The default notice message receiver just gets the standard notice text
>   * and sends it to the notice processor.  This two-level setup exists
>   * mostly for backwards compatibility; perhaps we should deprecate use of
>   * PQsetNoticeProcessor?
>   */
> 
> So I changed it to PQsetNoticeReceiver.

+1

As a side note, I'd like to clarify in the source comments or documentation
that PQsetNoticeProcessor() exists mainly for backward compatibility,
and PQsetNoticeReceiver() should be preferred. But that's a separate topic
from this patch.


> The attached v5 version patch
> has the changes for the same.

Thanks for updating the patches!


+static void notice_receiver(void *arg, const PGresult *result);

For consistency with the typedef for PQnoticeReceiver, it would be better
to name the argument "res" instead of "result".


+     * Set a custom notice receiver so that NOTICEs, WARNINGs, and similar

The "s" in "NOTICEs" and "WARNINGs" isn't needed.


+     * Trim the trailing newline from the message text passed to the notice
+     * receiver, as it always includes one, to produce cleaner log output.


"message text passed to the notice receiver" should be changed to
"message text returned by PQresultErrorMessage()"?

Regards,

-- 
Fujii Masao
NTT DATA Japan Corporation




pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Fix lwlock.c and wait_event_names.txt discrepancy
Next
From: Xuneng Zhou
Date:
Subject: Re: Add progressive backoff to XactLockTableWait functions