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 <vignes...@gmail.com> Reviewed-by: Álvaro Herrera <alvhe...@kurilemu.de> Reviewed-by: Fujii Masao <masao.fu...@gmail.com> Discussion: https://postgr.es/m/caldanm2xshpwrtlm-vl_hjcsae3+1y_n-jdear3-suxvqc3...@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(+)