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 1w9ZPb-001Y8k-10 for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 02:09:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9ZPZ-005sOm-2A for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 02:09:58 +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 1w9ZPY-005sOe-2a for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 02:09:57 +0000 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w9ZPV-00000000pLP-3AuL for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 02:09:56 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 7B4B47A007C; Sun, 5 Apr 2026 22:09:50 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Sun, 05 Apr 2026 22:09:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1775441390; x=1775527790; bh=UrXypUmy6L JjL6eqQtim9GCDlYXO8uFQVGvrL5I0jPQ=; b=kDk8tyeoNh9YwcxbhyXoeWfZa2 upm6TJ6yDcsLGmZP49apsklJ8aWicb4m7mV+mRCmKOuxgMZJi96q7qiK4VGl8SFx wSEiH9ezuP2/j5CHqtMhO+84tCfHCMss7QdvAUJKd0aFj4uU4uOESkAUwda9Oa6+ xQFuCn1zzJqzrTyKAhjb40PRQNqRd/7G5z1HM7PMjuwAFOphyuyLuTrciL2x0v0r UuTew39bqwWk0fRX8BkdKDO4G4+y8gsB4lD22/LRiCm7UdrNqttoDS+YUoo6Ogb5 fnQd+hNebCkZnN8xFemPuJa/ElxIf/z2AtXaA8HGS2bjr004ckopImv4BtfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1775441390; x=1775527790; bh=UrXypUmy6LJjL6eqQtim9GCDlYXO8uFQVGv rL5I0jPQ=; b=sPeZF12/Zj+06700XRPx/3x+lXcix4igVGRNNMnGQsk1wQCeCNb Glo8hbmwrzDqMNGIGGqmmCm7gT4TUU6ysePWz0SEfflIlhvk2+cSnRgX0Mb3RuP5 j9JK9oEJtcsDTS9IbIP59vbMAFHkOObfsOhlnQ9KUc36+HR28aPsOmQejWkVo/4U XimHRR0B2w8tAwHQ7hsBEYEluD0f1u02qnx9vk5YbrqWKs99w8DwPnuUg1z1uj2P LSs94kOSrVUBrps/immQlVxDMgDIQ6mmaUM1rl2vFo7QmA3l6Da2EDJA/q9Mo7QS Or/eta84ZpEp8avCnOi7uYJzboW6ArEX/vQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduieeggecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdfstddttddvnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtth gvrhhnpeeffffgledvffegtdevlefgtdeggffhvdekgfegteeiveejkeetudelveejhfeu geenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnh gurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepgedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrph hoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepmhhitghhrggvlhesphgrqhhuihgv rhdrgiihiidprhgtphhtthhopegrnhgurhgvrghssehprhhogigvlhdrshgvpdhrtghpth htohepthhglhesshhsshdrphhghhdrphgrrdhush X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 Apr 2026 22:09:49 -0400 (EDT) Date: Sun, 5 Apr 2026 22:09:48 -0400 From: Andres Freund To: Michael Paquier Cc: Andreas Karlsson , Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier Message-ID: References: <4653b0bf-5642-44f1-b059-7cc1db861da7@proxel.se> <1b901fbf-655d-434c-aff4-ee06313d31cd@proxel.se> <4be75b7d-587f-4217-b0ed-396949d90b43@proxel.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-06 09:01:24 +0900, Michael Paquier wrote: > On Fri, Mar 27, 2026 at 05:17:49PM -0400, Andres Freund wrote: > > With ee642cccc43c a change to syscache.h rebuilds 632 files. With ee642cccc43c > > reverted, it's just 196. > > Point received. > > > Leaving build impact aside, I don't think it's good to expose a relatively low > > level detail like syscache.h to most of the backend. It's imo something that > > only .c, never .h files should need. > > And as we already define SysCacheIdentifier in its own header, this > can be answered with the attached, removing the need for syscache.h in > objectaddress.h and inval.h. It's somewhat gross to have to include syscache_ids.h, but unfortunately with C++ not allowing forward declarations of C enums, I'm not sure we have particularly good alternatives. > The trick in genbki.pl was needed to avoid some noise due to -Wenum-compare > in a couple of files. You mean the include guards? Seems they should be added regardless of anything else. > Would you prefer a different option? Frankly, I'm a bit doubtful that ee642cccc43c is worth the cost. All this trouble to switch to SysCacheIdentifier in a bunch of places, when enums provide basically no typesafety. And sure, it maybe could help us to detect some ABI change, but I'm a bit doubtful anybody would think that renumbering syscaches in the back branches is sane. What are we actually gaining here? I'm doubtful that numeric keys fo syscaches, and one global list of them, is the right long term direction. What does this number actually gain us? C has working symbol names for global objects, why do we want a numeric key? Right now every syscache is allocated dynamically, in every backend. Every syscache lookup has to get the address of the actual syscache via static CatCache *SysCache[SysCacheSize] In our silliness we even exist to do this via different translation units (syscache.c -> catcache.c). ISTM a better direction would be to make MAKE_SYSCACHE(name,idxname,nbuckets) declare something like extern SysCache name; where SysCache is a forward declared struct type with the definition private to a C file or an internals header. And then have genbki emit definitions of those that gets included into a C file. That struct can then have all the necessary spce to avoid having to having to allocate as much and perhaps even get some of the metadata specified at compile time, so it doesn't have to be redone in every backend. > Would you prefer a different option? That would protect from large > rebuilds should syscache.h be touched in some way. A different option > would be to move get_object_catcache_oid() and > get_object_catcache_name() out of objectaddress.h to a different > header, limiting the scope of what's pulled in objectaddress.h. I frankly would just make those return an integer. > Anyway, the attached should take care of your main concern, I guess? It'd be better than today. I don't like the syscache ids being known everywhere, but it's better than those being known as well as the rest of syscache.h. Greetings, Andres Freund