Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier
Date
Msg-id aZQRnmp9nVjtxAHS@paquier.xyz
Whole thread Raw
In response to Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier
List pgsql-hackers
On Mon, Feb 16, 2026 at 04:47:24PM +0900, Michael Paquier wrote:
> The blast looks acceptable with inval.c in sight.  What's less
> acceptable is the set of failures generated, like:
> #3  0x00000000019e7ac4 in ExceptionalCondition
> (conditionName=0x1e31ff0 "cacheId >= 0 && cacheId < SysCacheSize &&
> SysCache[cacheId]", fileName=0x1e31e80 "syscache.c",
> lineNumber=223) at assert.c:65
> #4  0x00000000019d277e in SearchSysCache1 (cacheId=4294967295,
> key1=16778) at syscache.c:223

The issue here is that we have three code paths that are perfectly OK
with dealing in negative syscache ID values:
- DropObjectById()@dependency.c
- AlterObjectRename_internal()@alter.c
- AlterObjectNamespace_internal()@alter.c

The best path moving forward on this one that I can think of in
objectaddress.c would be to add an extra "invalid" value in the enum
of SysCacheIdentifier and attach that to the ObjectProperty that we
can use to mark when we don't have an ID assigned.  That would have
the advantage to self-document the behavior that we don't have a
syscache entry at all when using this invalid ID.

What do you think about the updated version attached?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Henson Choi
Date:
Subject: Re: Row pattern recognition
Next
From: Zsolt Parragi
Date:
Subject: Re: [OAuth2] Infrastructure for tracking token expiry time