From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marc Mamin <marc@intershop.de>
Cc: pgsql-bugs@postgresql.org
Cc: Joe Conway <mail@joeconway.com>
Subject: Re: BUG #6168: db_link may generate additional unformatted log entries in stderr
Date: Fri, 19 Aug 2011 11:12:24 -0400
Message-ID: <7941.1313766744@sss.pgh.pa.us> (raw)
In-Reply-To: <201108191153.p7JBr6b6080022@wwwmaster.postgresql.org>
References: <201108191153.p7JBr6b6080022@wwwmaster.postgresql.org>
"Marc Mamin" <marc@intershop.de> writes:
> I've stumbled on a few entries in my stderr log where the line prefix where
> missing. e.g.:
> 2011-08-08 13:12:16 CEST|4e3fc490.17bc|6076|foo|DETAIL: Returned type
> character ...
> 2011-08-08 13:12:16 CEST|4e3fc490.17bc|6076|foo|CONTEXT: PL/pgSQL
> function "bm_ ...
> 2011-08-08 13:12:16 CEST|4e3fc490.17bc|6076|foo|STATEMENT: Select
> coalesce(colu ...
> => NOTICE: table "sessions_summary_raw_20110815" does not exist, skipping
> => NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index
> "pk_sessions_s ...
> => NOTICE: table "sessions_site_summary_raw_20110815" does not exist,
> skipping
> NOTICE entries should moreover not be logged !
> Those entries are coming from db_link.
I guess your test case is looping back to the same Postgres instance?
What I see here is that the target backend (the one connected to by
dblink) logs the warning as expected, and then the dblink one also
prints the warning to stderr. This is because dblink does not override
either PQsetNoticeReceiver or PQsetNoticeProcessor, so libpq provides
its default behavior of printing warnings/notices on stderr.
It'd probably make sense for dblink to supply a notice receiver that
converts the result into an ereport() call, much as it does for actual
error results (in fact it could likely use dblink_res_error for that).
But frankly this is an enhancement request, not a bug. The entire point
of the stderr logging mechanism is to capture random printouts to stderr
that might happen in code called by the backend, and it's doing exactly
what it's supposed to.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, marc@intershop.de, mail@joeconway.com
Subject: Re: BUG #6168: db_link may generate additional unformatted log entries in stderr
In-Reply-To: <7941.1313766744@sss.pgh.pa.us>
References: <201108191153.p7JBr6b6080022@wwwmaster.postgresql.org> <7941.1313766744@sss.pgh.pa.us>
* 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