"Unified logging system" breaks access to pg_dump debug outputs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: "Unified logging system" breaks access to pg_dump debug outputs
Date: 2020-09-14 20:50:25
Message-ID: 1173106.1600116625@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

pg_dump et al have some low-level debug log messages that commit
cc8d41511 converted to pg_log_debug() calls, replacing the previous
one-off logging verbosity system that was there. However, these
calls are dead code as things stand, because there is no way to set
__pg_log_level high enough to get them to print.

I propose the attached minimal patch to restore the previous

Alternatively, we might consider inventing an additional logging.c
function pg_logging_increase_level() with the obvious semantics, and
make the various programs just call that when they see a -v switch.
That would be a slightly bigger patch, but it would more easily support
programs with a range of useful verbosities, so maybe that's a better

In a quick look around, I could not find any other unreachable
pg_log_debug calls.

(Note: it seems possible that the theoretical multiple verbosity
levels in pg_dump were already broken before cc8d41511, because
right offhand I do not see any code that that removed that would
have allowed invoking the higher levels either. Nonetheless, there
is no point in carrying dead code --- and these messages *are*
of some interest. I discovered this problem while trying to
debug parallel pg_restore behavior just now, and wondering
why "-v -v" didn't produce the messages I saw in the source code.)

regards, tom lane

Attachment Content-Type Size
restore-multiple-log-levels-in-pg_dump-1.patch text/x-diff 1.4 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2020-09-14 21:00:48 Re: Allow ERROR from heap_prepare_freeze_tuple to be downgraded to WARNING
Previous Message Neha Sharma 2020-09-14 20:15:52 Re: Subscription test 013_partition.pl fails under CLOBBER_CACHE_ALWAYS