From: Andrei Lepikhov <lepihov@gmail.com>
To: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Log remote NOTICE, WARNING, and similar messages using ereport()
Date: Tue, 22 Jul 2025 14:30:48 +0200
Message-ID: <39ac724e-58c8-4661-9e88-cb4ee97cb00e@gmail.com> (raw)
In-Reply-To: <E1ue5Sg-0008kc-0D@gemulon.postgresql.org>
References: <E1ue5Sg-0008kc-0D@gemulon.postgresql.org>
On 22/7/2025 07:22, Fujii Masao wrote:
> 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.
Perhaps I'm wrong, but it seems to me that you also need to add the
libintl link to the Makefile of each module that uses the
libpqsrv_notice_receiver routine.
At least, without this patch, I can't build master under MacOS:
Undefined symbols for architecture x86_64:
"_libintl_gettext", referenced from:
_libpqsrv_notice_receiver in dblink.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
--
regards, Andrei Lepikhov
Attachments:v0-0001-Fix-Makefile-in-modules-employing-the-libpqsrv_no.patch (text/plain, 1.2K) download
From 6a577860c0a7eaadd43d931f737ff5f2a954b597 Mon Sep 17 00:00:00 2001
From: "Andrei V. Lepikhov" <lepihov@gmail.com>
Date: Tue, 22 Jul 2025 14:25:48 +0200
Subject: [PATCH v0] Fix Makefile in modules employing the
libpqsrv_notice_receiver function
---
contrib/dblink/Makefile | 1 +
contrib/postgres_fdw/Makefile | 1 +
2 files changed, 2 insertions(+)
diff --git a/contrib/dblink/Makefile b/contrib/dblink/Makefileindex fde0b49ddbb..ea6396bc70c 100644--- a/contrib/dblink/Makefile+++ b/contrib/dblink/Makefile@@ -6,6 +6,7 @@ OBJS = \
dblink.o
PG_CPPFLAGS = -I$(libpq_srcdir)
SHLIB_LINK_INTERNAL = $(libpq)
+SHLIB_LINK = $(filter -lintl, $(LIBS))
EXTENSION = dblink
DATA = dblink--1.2.sql dblink--1.1--1.2.sql dblink--1.0--1.1.sql
diff --git a/contrib/postgres_fdw/Makefile b/contrib/postgres_fdw/Makefileindex adfbd2ef758..bba2551df51 100644--- a/contrib/postgres_fdw/Makefile+++ b/contrib/postgres_fdw/Makefile@@ -12,6 +12,7 @@ PGFILEDESC = "postgres_fdw - foreign data wrapper for PostgreSQL"
PG_CPPFLAGS = -I$(libpq_srcdir)
SHLIB_LINK_INTERNAL = $(libpq)
+SHLIB_LINK = $(filter -lintl, $(LIBS))
EXTENSION = postgres_fdw
DATA = postgres_fdw--1.0.sql postgres_fdw--1.0--1.1.sql postgres_fdw--1.1--1.2.sql
--
2.50.1
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: lepihov@gmail.com, fujii@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Log remote NOTICE, WARNING, and similar messages using ereport()
In-Reply-To: <39ac724e-58c8-4661-9e88-cb4ee97cb00e@gmail.com>
* 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