Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vRIXe-00Avoc-2b for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 23:15:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vRIXd-005j0H-2k for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 23:15:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vRIXd-005j08-0u for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 23:15:17 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vRIXa-003BLq-1b for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 23:15:16 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id D65701400135; Thu, 4 Dec 2025 18:15:13 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 04 Dec 2025 18:15:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1764890113; x=1764976513; bh=7An1v+LsYf tSAfsprNdeh315svOXEfeFEPpMOKCynqk=; b=f+XRCOKnrwWKT3K0e2leecbAjW 2dfBvFhavUB6yCXYubx0FiYKVUOYFym4lX1UGQ2PUaBJLn8Vyn7xePVHBL/9tLWd lMRUa3RHpLg3R6byXddf6t9DP/843eGK69lZ0KL7OEzP+oRguP/dGeRvuC3EsRqO hnedmHPJQhyZ34LDgbgQRXReN9dNoZ3R8tw+mIPEybLDciCR8syxbFv1tnvd9lWu s6GmsT0J95dBxIGG39lUZVZTzjHe4sBXvLIvFNyeEMkaiJBxNS6L56RiIbBuDv2z 1wndBONe/G2BEODc9plJltnxXllKD6BFwpxaPCqNVb2K1ufpHUFBmEfnXUMg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1764890113; x=1764976513; bh=7An1v+LsYftSAfsprNdeh315svOXEfeFEPp MOKCynqk=; b=I5TT2N1r+zyF1joTbEEXDDnqAEtKjBOTJD7h1WivY4657ic3edp 1Sea/EY3Gpct8lmtQsBX5Z6TEEHRVERhmkM6bwfQfOf8LIuKXcQuCXckF01iIXlT 3RN4GuUnh/C/R+I2njXtmRU4pkbvEFeel5mE/QBXUdZVt5N/hPFgPsVHCFzuYzST Bn6p8o1Plq+/f2M3ZFk83A2FQ2GCX1//OLNo4IGykXLcvO+IWVY1g7GoK/KIW7eM zKGOxaT8LAIEuNlqTpfwewGjxzZ8aFHLJGIYUl4SHEmc59VrBudhCphZVUUHuu3Q blb+09s37BbCm7U22Y8m0c5ld6uxR56eqNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeikeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhluc fvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecu hfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuih gvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeegfffh keeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidpnhgs pghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgrmhhimh hsvghihhesghhmrghilhdrtghomhdprhgtphhtthhopehlihdrvghvrghnrdgthhgrohes ghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsth hsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Dec 2025 18:15:11 -0500 (EST) Date: Fri, 5 Dec 2025 08:14:58 +0900 From: Michael Paquier To: Sami Imseih Cc: Chao Li , PostgreSQL Hackers Subject: Re: [Proposal] Adding callback support for custom statistics kinds Message-ID: References: <4FEEC2B8-D9CF-4BD0-AA7E-44CE3E27ADD8@gmail.com> <5EC13E39-B41E-464A-B382-0ACEB18A15BB@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="n8d/eIvv8Bq15NV2" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --n8d/eIvv8Bq15NV2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --n8d/eIvv8Bq15NV2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmkyFfIACgkQnvQgOdby QH1jsw/+If2AyYBtVvXj0esBKIDiZpTpPoEWJSKYL4HyoCipPW+ziN+h5O3P1PpW jeS84JTC+T8yhcARN46QGQWQpcsiwFjzQTeeSxUkYjq6jrYpBaH7EcNa/KZV4sHT sdSt33m8+pN6MNsAYsM/feheMBZwbxmiWMYt36qfgWyaHwM7onQrzIDaxRmJKNml 07e/it1WE4if3/9IXiWBdBX1TvKFnq6vUTtiKAqFgyM7Geb2yML4UPbIYsW8tWpb mRWmGg/hsXzDysAO4YbaecT4QL3tU3BUPO+AZ67VYvH4lQfxAHJtEIEhPrC9pclI FTlg/bjtKgjRnlD7/godoxxvyDE5kLGpoaaaA+oweq4uMk4IT3mcd3GgUgfTiFUb LxZx2Fg0X9dw2UAtQh/MS5UBgAhZBlqNIav/Cig2TUNi9h20QXck0+tztnulb+2T xfmcK7nawiCcvmJCpUDrf2o2qQrGVpWZGAQZMnJBCkvnWQpgSs8FL6p63mFSDTGC qwFRoDCf2VgOyWTmiykpFCe5NB5upzbtnmaxht6SJG0VFWFtNbHVaqtPK+a1v549 7xYQ1kDueMC4AwP5EUH22fwDgJodSqsKKy8KvOvKadSbqVAHhDtaRGcU+q9KR8ZK s5XDGB7EtaQHCatSmpAyD0xxvGCjZxxUx8XT+UKmyDHCQ4Cb7Mg= =97OO -----END PGP SIGNATURE----- --n8d/eIvv8Bq15NV2--