Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier
Date: 2026-02-17 08:20:44
Message-ID: 4be75b7d-587f-4217-b0ed-396949d90b43@proxel.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-02-17 08:30:02 Re: [PATCH] Provide support for trailing commas
Previous Message Kirill Reshke 2026-02-17 08:17:17 Re: Document How Commit Handles Aborted Transactions