Re: Add pg_stat_log_messages: cumulative statistics about server log messages (was: Add contrib module pg_stat_log: cumulative statistics about server log messages)

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Fabrízio Mello <fabrizio(at)planetscale(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, "mail(at)joeconway(dot)com" <mail(at)joeconway(dot)com>, "nik(at)postgres(dot)ai" <nik(at)postgres(dot)ai>, "wolakk(at)gmail(dot)com" <wolakk(at)gmail(dot)com>
Subject: Re: Add pg_stat_log_messages: cumulative statistics about server log messages (was: Add contrib module pg_stat_log: cumulative statistics about server log messages)
Date: 2026-09-29 05:46:16
Message-ID: CAAc5aFOoNSw7LiyDN0CtJKxTxOSMXYmuR4fqprSPJc-1=sicsw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Fabrizio,

On Tue, Sep 29, 2026 at 1:21 AM Fabrízio Mello <fabrizio(at)planetscale(dot)com>
wrote:

> On Thu, Sep 3, 2026 at 4:58 AM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
> >
> > Your email didn't motivate why this extension should be in core instead
> of
> > maintained as an external extension?
> >
>
> Thanks Daniel, that's a fair point, and after Nikolay's strong case for
> core [1] I'm convinced this belongs there: error counters by SQLSTATE
> are fundamental monitoring, counters are far easier to expose to
> monitoring systems than log access (which mixes diagnostics with
> statements and potentially sensitive data), and external extensions
> take a long time to propagate to managed platforms, if ever.
>
> So here is v2, reworked from a contrib module into a builtin cumulative
> statistics kind with a core view. Summary of what changed:
>

Thanks for the updated patch!

I did not look at it in details, just at what outcome it would provide and I
think it would also
make sense to provide this information on a per-backend basis. There is
ongoing work
to redesign the per-backend statistics infrastructure [1], which, I think,
might be worth
considering for this feature.

[1] https://postgr.es/m/anCjoFkGah/uB7lw%40bdtpg

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-09-29 05:47:22 Silence -fsanitize=function where we cast function pointers on purpose
Previous Message Nikhil Kumar Veldanda 2026-09-29 05:39:42 Re: ZSTD TOAST compression, and an extensible compression method encoding