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

From Andreas Karlsson
Subject Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier
Date
Msg-id 4be75b7d-587f-4217-b0ed-396949d90b43@proxel.se
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 2/17/26 7:58 AM, Michael Paquier wrote:
> 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?

Yeah, that looks like a quite nice improvement. My only comment is that 
if it was me I would have split it into two patches, one introducing the 
invalid and one replacing int. But you are much more familiar than me 
with what granularity of commits the project prefers

Andreas




pgsql-hackers by date:

Previous
From: Kirill Reshke
Date:
Subject: Re: Document How Commit Handles Aborted Transactions
Next
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Provide support for trailing commas