From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disallow serialized callbacks for fixed-sized custom stats kinds
Date: Wed, 14 Oct 2026 23:47:24 +0000
Message-ID: <E1xH8gu-00000001et8-2u90@gemulon.postgresql.org> (raw)
Disallow serialized callbacks for fixed-sized custom stats kinds
The pgstats callbacks to_serialized_name() and from_serialized_name()
are documented as being for variable-sized stats only, as they map an
entry hash key to a name written to the on-disk stats file.
pgstat_register_kind() did not enforce this policy for custom stats
kinds. Enforcing this behavior is more interesting since 44539786b829,
where a stats kind can begin pointing at its own hash table, offering as
guarantee that a PGSTAT_FILE_ENTRY_NAME will never match a fixed-sized
stats kind at startup, should the same kind ID be reused across restart
with a different kind info.
See also 0d110901f0ef that has dealt with a similar issue, for
PGSTAT_FILE_ENTRY_HASH.
Author: Sami Imseih <samimseih.pg@gmail.com>
Discussion: https://postgr.es/m/CAN4CZFMxuOOuYV14+i3YcPG-16q02eBtSVa82J111=ZnDwSicA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3c6665bf0266a7ae78117c3ed0299bfbd1f1331a
Modified Files
--------------
src/backend/utils/activity/pgstat.c | 4 ++++
1 file changed, 4 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz
Subject: Re: pgsql: Disallow serialized callbacks for fixed-sized custom stats kinds
In-Reply-To: <E1xH8gu-00000001et8-2u90@gemulon.postgresql.org>
References: <E1xH8gu-00000001et8-2u90@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox