Re: Reducing the log spam

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Isaac Morland <isaac(dot)morland(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Reducing the log spam
Date: 2025-04-03 07:22:04
Message-ID: ea0b49155aa6481ab7a997a1729c55cc73a62bfb.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2025-04-02 at 15:23 -0400, Tom Lane wrote:
> Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> writes:
> > Filtering log messages by SQLSTATE might be useful for some users,
> > but I'm unsure if it should belong in the core. There are also other
> > potential filtering needs, such as by application name, client host,
> > database, or roles. Adding only SQLSTATE filtering may not be good idea,
> > while supporting all possible cases in the core wouldn't be practical either.
>
> > Given that, I think implementing this as an extension using emit_log_hook
> > would be a better approach. Anyway, I'd like to hear more opinions from
> > other hackers on this.
>
> I took a brief look and I concur with Fujii-san's conclusion: this'd
> be a fine extension a/k/a contrib module, but it seems a bit too
> opinionated about what sort of filtering is needed to be appropriate
> within elog.c itself.
>
> Also, just as a minor coding thought, I'd suggest using -1 not 0
> to terminate the array of encoded SQLSTATEs, rather than assuming
> that nobody would write 00000.  Compare commit 58fdca220.

I agree with these assessments and will withdraw the patch.

Yours,
Laurenz Albe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-04-03 07:24:46 Re: Fwd: [BUG]: the walsender does not update its IO statistics until it exits
Previous Message Daniel Gustafsson 2025-04-03 07:20:34 Re: Extensible user mapping handler for FDW