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 1vUwse-009kAr-1w for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Dec 2025 00:56:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vUwsd-00EqLa-1C for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Dec 2025 00:56:04 +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 1vUwsc-00EqLR-12 for pgsql-hackers@lists.postgresql.org; Mon, 15 Dec 2025 00:56:03 +0000 Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vUwsb-000hWW-0i for pgsql-hackers@lists.postgresql.org; Mon, 15 Dec 2025 00:56:02 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 4317A7A0104; Sun, 14 Dec 2025 19:55:59 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Sun, 14 Dec 2025 19:55:59 -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=1765760159; x=1765846559; bh=NN8Wzh9Jdx CP/Ztg+0RfIlyDuIc6A1kslnx4fTh+M7s=; b=ec4WS3ggLdYRiNi0hRDFHQmRE+ VZKBhQLsjrnD1muGomRMQjYYVXPcQwhsDt3uSqDzdWIlqhbEIvxPsk1xLnDPcgFM MoywA2PejqFBwYkBKQ2wcmvoFSKFf5uAzSR/suzwpohFVzplW6UTmrvAJf7QFVYm ZEwRIgFqMwHF1OlSU7LJom5dqJ1nkwCNePncgluWvRhFewJr104aZw48Wn8RHNgL UEbRTWBoGyjSGAcSggOo9APpxab5n2WXBgfg9IQYgCYjHlUIfTiPRB8xL86D3bDV 2GYHcEG/r7jq/IAzRceTdBOweBQouBPQq5W/8WY5HKevwUWvU+sAyTNl5wVQ== 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= 1765760159; x=1765846559; bh=NN8Wzh9JdxCP/Ztg+0RfIlyDuIc6A1kslnx 4fTh+M7s=; b=Ec8+qlkcqfBfv4FXUB6ml1L8xbCP2oG0Lyt9N3/ofmqIvIBtHKe eVKJMpVQ/9EwCaPFIvu/1zd+5VNaR7WyCUfL0ciOZjOmzJ0CIzuM7yd6GTZ1wPn8 ypQ8EmAjK7gDXvN3vVFyfXUb5bnoe1v7e08ZqcF7hjtLt8o6JPUhiszlcjZAcZVf g5p6OljBjeuvfvOikuHaiq4orVt4kcsnvNmSNsHKXBFcIrQh2kVJcWOLWAmTV48C lPgYBZn1QtyUVL+GGVYhV1DvbC4corskRy+TOBxAmwae32cYs+cXJDM7OfysusZ/ UkH+fXIGr9Tey+bM/ShVt4HKjtD5xkfH2Sg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefheegvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehsrghmih hmshgvihhhsehgmhgrihhlrdgtohhmpdhrtghpthhtoheplhhirdgvvhgrnhdrtghhrgho sehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhish htshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 14 Dec 2025 19:55:57 -0500 (EST) Date: Mon, 15 Dec 2025 09:55:43 +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: <4E61FDC4-CFBB-4116-980F-75ADD245A1F6@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="T2h1pKBLsXtHPvIw" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --T2h1pKBLsXtHPvIw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Dec 13, 2025 at 06:33:41PM -0600, Sami Imseih wrote: > I just remembered that we should document the new callbacks in [0] with a > brief explanation of their purpose and a reference to test_custom_stats > as an example of usage. What do you think? I'd rather keep the documentation simpler, pointing only to the code templates we have and pgstat_internal.h. One reason is that code in the documentation tends to rot very easily, particularly when applied to plugin APIs. If you think that some of the callbacks of pgstat_internal.h deserve more documentation or explanation, let's do that directly in the header. Saying that, I have tweaked a bit more the patch this morning and applied the result after splitting things in two: one for the core backend changes and one for the tests of the new APIs. Some comments and error strings have been simplified and I have noticed some more inconsistencies after a follow-up read. Another thing that I did not like is the use of "long" for the offset, which is not portable. We have a drop-in portable replacement for seeks and offsets: fseeko() and pgoff_t. That was in the test code, but still let's keep things more portable in the long run without a 4-byte limitation on WIN32. I guess that we are done for this thread then. -- Michael --T2h1pKBLsXtHPvIw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmk/XI8ACgkQnvQgOdby QH2JxA//b+kIeURLMh0Ra/bTWh7dQRd4/Ku0us3XJKifYEZ6iR64kj3BZPWx3A6y 5Kb2ADMWhBcmp3Z9FN5f3RQsiamKnxCN79aAFKc+9EC54J9x5xT+EQ8NDkC8LHL2 At23jWrOGSsm2++Ii1R1ia6twCmh7xSxsxPRrZK8lsy0zcZDJYMVXYbQkkLsfMRb 1pYYGFxdcOAFEy7Q7ejFuYPw3K9JXMDvi8FMg6lrajSTjCnQCNGOx4QLRv2BLBrB arOX0PM7fFl3eA4ND3shAc6iLwy+8s/YprrcUzxtrKekQg/aVA7KxuGFn0oCI302 Mi9/vIXf7Qx+NJCUBtwFhiCN4UzwX12jjqS8rf4vdHLLbrMYt85i30nDQJ8E7A2W CB13L76IbfxpyVk+ww7KhPj361kPKMnINGJX5msZ5wJee0uOJ/Gy45y/9haBBuwH RfOfZMPjHARC2frW/Iv3UZ1mNyoua39SwpVx8JRq3SgkvZUrqrqBRikgdJpoP9Qy 4JID80F/J73rhFMKQX/Czc6eQeLWdguKlr273JAxQO4qN4Zr12PrHDbdJsYg52xL PydVjdPAiXLZ+oXfNqIyr6xI1iLHqehtUEFvX9OVuuBGQrN1D5ONOBN2uhPl5j9C dsayXwh7ldUEHyGqoebsRdTB5Hon9H08BRGaFXICg+zfAlfrSGg= =3lRt -----END PGP SIGNATURE----- --T2h1pKBLsXtHPvIw--