Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-02-13T04:07:00Z
Lists: pgsql-hackers
On Thu, Feb 12, 2026 at 11:17:37AM -0500, Tom Lane wrote: > 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*. Well. That's annoying. This one is important to be careful about. > 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). Enforcing a type for this sounds like a good idea in the long term on HEAD, yes, even putting the ABI argument aside for a moment. I'd suggest the addition of an extra typedef in the code generated for syscache_ids.h to save from a couple of enum markers in these declarations, once refactored to use the new enum type. > 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? Adding a comment explaining why this function needs to exist would be good. -- Michael
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Reduce presence of syscache.h in src/include/
- e0fa5bd14656 19 (unreleased) landed
-
Switch SysCacheIdentifier to a typedef enum
- ee642cccc43c 19 (unreleased) landed
-
Add concept of invalid value to SysCacheIdentifier
- c06b5b99bbb0 19 (unreleased) landed