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 1vqZNz-00DOWk-0K for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Feb 2026 16:17:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vqZNy-009jmv-03 for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Feb 2026 16:17:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vqZNx-009jmm-2K for pgsql-hackers@lists.postgresql.org; Thu, 12 Feb 2026 16:17:46 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vqZNw-00000000LLE-1bVA for pgsql-hackers@lists.postgresql.org; Thu, 12 Feb 2026 16:17:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 61CGHbIO289126 for ; Thu, 12 Feb 2026 11:17:37 -0500 From: Tom Lane To: pgsql-hackers@lists.postgresql.org Subject: Our ABI diff infrastructure ignores enum SysCacheIdentifier MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <289116.1770913051.0@sss.pgh.pa.us> Date: Thu, 12 Feb 2026 11:17:37 -0500 Message-ID: <289125.1770913057@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <289116.1770913051.1@sss.pgh.pa.us> I discovered $SUBJECT while working on commits dbb09fd8e et al. The point of those commits was to back-patch addition of a syscache that previously existed only in v18+, so naturally I was concerned about not breaking ABI by changing any existing syscache's ID. I tested whether abidiff would bleat about it if I intentionally changed an ID, and found that *it didn't*. I don't think this is (quite) a bug in libabigail. They are pretty clear that what they regard as ABI is: ... the descriptions of the types reachable by the interfaces (functions and variables) that are visible outside of their translation unit. We do not use enum SysCacheIdentifier as the declared type of any global variable or any globally-visible function argument or result. Therefore it's not ABI per their definition. This is frankly pretty scary. Now that we know the rules, we can fix it for enum SysCacheIdentifier, but we have other things that are similarly vulnerable. The thing I am most concerned about right now is enum GUCs. The guc.c APIs mandate that those be declared as type int, so I think (haven't actually checked) that most if not all of the associated enum values will not be perceived as ABI-relevant by abidiff. What can we do about that? As for SysCacheIdentifier, the root of the problem is that SearchSysCache and friends are declared to take "int cacheId" not "enum SysCacheIdentifier cacheId". Likely we should change that in HEAD, but that'd be an actual not theoretical ABI break (the enum's not necessarily int-width). In the back branches I'm thinking about adding a dummy function just for this purpose, more or less as in the under-commented patch attached. Thoughts? regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="0001-make-SysCacheIdentifier-be-part-of-ABI.patch"; charset="us-ascii" Content-ID: <289116.1770913051.2@sss.pgh.pa.us> Content-Description: 0001-make-SysCacheIdentifier-be-part-of-ABI.patch Content-Transfer-Encoding: quoted-printable commit 12d2a8cd596d63dd908149b9140f527b723585cc Author: Tom Lane Date: Sat Jan 10 18:28:39 2026 -0500 Make SysCacheIdentifier be ABI. diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/= syscache.c index f7f4f56a4d2..1af3ab3afdf 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -671,6 +671,14 @@ GetSysCacheHashValue(int cacheId, return GetCatCacheHashValue(SysCache[cacheId], key1, key2, key3, key4); } = +/* + * Dummy function with an "enum SysCacheIdentifier" parameter. + */ +void +SysCacheDummy(enum SysCacheIdentifier cacheId) +{ +} + /* * List-search interface */ diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h index b541911c8fc..052c4550d22 100644 --- a/src/include/utils/syscache.h +++ b/src/include/utils/syscache.h @@ -72,6 +72,8 @@ extern Datum SysCacheGetAttrNotNull(int cacheId, HeapTup= le tup, extern uint32 GetSysCacheHashValue(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4); = +extern void SysCacheDummy(enum SysCacheIdentifier cacheId); + /* list-search interface. Users of this must import catcache.h too */ struct catclist; extern struct catclist *SearchSysCacheList(int cacheId, int nkeys, ------- =_aaaaaaaaaa0--