Re: [Proposal] Adding callback support for custom statistics kinds
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Sami Imseih <samimseih@gmail.com>
Cc: Chao Li <li.evan.chao@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-04T23:14:58Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix const correctness in pgstat data serialization callbacks
- 167cb26718e3 19 (unreleased) landed
-
test_custom_stats: Add tests with read/write of auxiliary data
- 481783e69f14 19 (unreleased) landed
-
Allow cumulative statistics to read/write auxiliary data from/to disk
- 4ba012a8ed9c 19 (unreleased) landed
-
test_custom_stats: Test module for custom cumulative statistics
- 31280d96a648 19 (unreleased) landed
-
injection_points: Remove portions related to custom pgstats
- d52c24b0f808 19 (unreleased) landed
-
Rename routines for write/read of pgstats file
- ed823da12891 19 (unreleased) landed
On Thu, Dec 04, 2025 at 05:00:10PM -0600, Sami Imseih wrote: > Thanks for the input! Yes, this is a trade-off between putting > responsibility on the > extension vs core. The initial thought I had was exactly like yours, but it will > be easier to get something pushed if we make the core changes as minimal as > possible. If there are enough complaints in the future, this can be revisited. > Particularly if there is a common patterns for file cleanup, this > could be turned > into a core utility. Another way to shape it would be to have an in-core routine that provides a default logic for the actions to take depending on the write, read or discard state, with the state and a FILE* as arguments. The main pgstats file would call that, modules may decide to use it. > However, as discussed off-list, I do think moving the custom kind tests from > injection points to the new test module is a prerequisite. I rather > not have us push a new test module that is doing duplicate work as the injection > stats tests. > I worked on this refactoring today and plan to have a patch ready for review > by tomorrow. Cool, thanks! -- Michael