Re: [Proposal] Adding callback support for custom statistics kinds - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [Proposal] Adding callback support for custom statistics kinds
Date
Msg-id aPsUjoasN6_6e-ww@paquier.xyz
Whole thread Raw
In response to Re: [Proposal] Adding callback support for custom statistics kinds  (Sami Imseih <samimseih@gmail.com>)
List pgsql-hackers
On Thu, Oct 23, 2025 at 07:57:38PM -0500, Sami Imseih wrote:
> I was trying to avoid an extra field in PgStat_KindInfo if possible, but
> it's worthwhile to provide more flexibility to an extension. I will go
> with this.

Yes, I don't think that we will be able to avoid some refactoring of
the existing callbacks.  The introduction of a new one may not be
completely necessary, though, especially if we reuse the reset
callback to be called when the stats read and write finish to close
any fds we may have opened when processing.

Maintaining the state of the files opened within each stat kind code
across multiple calls of the new "serialized" callback feels a bit
more natural and more flexible, at least it's my take on the matter.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Tab completion for large objects
Next
From: Michael Paquier
Date:
Subject: Re: Avoid handle leak (src/bin/pg_ctl/pg_ctl.c)