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) - Mailing list pgsql-hackers
From
Bertrand Drouvot
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)
On Thu, Sep 3, 2026 at 4:58 AM Daniel Gustafsson <daniel@yesql.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