pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Log remote NOTICE, WARNING, and similar messages using ereport()
Date: Tue, 22 Jul 2025 05:22:46 +0000
Message-ID: <E1ue5Sg-0008kc-0D@gemulon.postgresql.org> (raw)

Log remote NOTICE, WARNING, and similar messages using ereport().

Previously, NOTICE, WARNING, and similar messages received from remote
servers over replication, postgres_fdw, or dblink connections were printed
directly to stderr on the local server (e.g., the subscriber). As a result,
these messages lacked log prefixes (e.g., timestamp), making them harder
to trace and correlate with other log entries.

This commit addresses the issue by introducing a custom notice receiver
for replication, postgres_fdw, and dblink connections. These messages
are now logged via ereport(), ensuring they appear in the logs with proper
formatting and context, which improves clarity and aids in debugging.

Author: Vignesh C <vignesh21@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CALDaNm2xsHpWRtLm-VL_HJCsaE3+1Y_n-jDEAr3-suxVqc3xoQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/112faf1378ee62db75cd9e3223c86bf53b8c2736

Modified Files
--------------
contrib/dblink/dblink.c                            |  7 +++++
contrib/postgres_fdw/connection.c                  |  3 +++
.../libpqwalreceiver/libpqwalreceiver.c            |  3 +++
src/include/libpq/libpq-be-fe-helpers.h            | 30 ++++++++++++++++++++++
4 files changed, 43 insertions(+)



view thread (4+ messages)  latest in thread

Message-ID: <E1ue5Sg-0008kc-0D@gemulon.postgresql.org>
Permalink:  ../E1ue5Sg-0008kc-0D@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ue5Sg-0008kc-0D@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Log remote NOTICE, WARNING, and similar messages using ereport()
  In-Reply-To: <E1ue5Sg-0008kc-0D@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox