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-12T02:58:54Z
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 Wed, Dec 10, 2025 at 12:36:36PM -0600, Sami Imseih wrote: > .. and after giving this more thought, I actually don't think we should > do any validation for any of the callbacks. If an extension is writing > to any file ( core or custom ), naturally they will want to read it back. > Now I am not sure what these validations are protecting us against. > Also, maybe the extension wants to just read data from the main stats > file, I could see that use-case, perhaps. > > So, I am proposing removing the validation altogether. What do > you think? The to and from callbacks are coupled with each other, so there may be a point in making sure that if one is defined so is the other. Now, I have never done any enforcement for the existing from/to serialization callbacks either because it would be quickly clear for one what needs to be done when implementing a custom kind. So I'd agree with just removing these checks and keep the code simpler. FWIW, I have begun putting my hands on your patch, editing it at some degree. I am not sure that I will be able to finish that today, but I'm working towards getting something done. -- Michael