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 1w9XPN-001WKJ-1C for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 00:01:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9XPL-005Z8n-2i for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 00:01:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w9XPL-005Z8f-0M for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 00:01:35 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w9XPJ-00000000lYn-1lQA for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 00:01:34 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 4E1FF7A00DC; Sun, 5 Apr 2026 20:01:32 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Sun, 05 Apr 2026 20:01:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; 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=1775433691; x=1775520091; bh=HejTuR812b G4D4NQikS+xqVqnRPSp8BcYDsFGt7Y/90=; b=bTHDBS/6E7NcUnLI+TS91Xl5ot nOpXgJjrQag9rOIZNK0cVDhE8txCOJqjPMXxPTkuTZNrQe4Qzvg/spdU84ayFwZd xVHU4+90SanIKEhj3XtsP6dCrak7U2sxZiCGT9+loEyREUO7HDTXWCulLbsQB4Z9 qLvpXcONIbTAe+xbX4m2ETObKS4QWpzghi8ytwP5ecYKVVlp/pzcHIBaC8Km7aZQ vcENtlrNAo/YQbN8bfPgbPyQJdgAytx1W4VKTT2ePwdBShFwJ10IfACmioD8KTst 48QQLmMnUl99unoW7kIkuq4EG7u+83ohf2SujgcE/4KFRMkCJiyhBAOIPEYg== 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= 1775433691; x=1775520091; bh=HejTuR812bG4D4NQikS+xqVqnRPSp8BcYDs FGt7Y/90=; b=UL92J4nyE8FqtByyJnCnYt7Yg8MzN2EOIX3sRucIPE98NsICy/j GN0JPrUg6PIrmrD60yH7D+WSMuaR9maGZqUnVO26Xu10C6D2Zl3c2WTdGGJp8el+ UCoKL7Fd6VUYc22eJFR7e12DvzWyg6PrXkZ8mvC3sFtiA3+fX1i3MZjq/I5GMgwL /SRJ/5DapzPGid7df1NNT9D+fzlJFXRg9Kty6R/cDz1zINVkpv/rgcfCSOWlgHzp WZh4zy6vuwd7C73IUXKCaqS/hIYWPuGRYPSq20GXPqR3qvZqAUvygyRUcOCodPR0 etyiPqa1V5Oh2Lv6dGfulpagBsu54tJ9Y9g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduiedukecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrnhgurh gvshesrghnrghrrgiivghlrdguvgdprhgtphhtthhopegrnhgurhgvrghssehprhhogigv lhdrshgvpdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhushdprhgtphhtth hopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhr gh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 Apr 2026 20:01:29 -0400 (EDT) Date: Mon, 6 Apr 2026 09:01:24 +0900 From: Michael Paquier To: Andres Freund Cc: Andreas Karlsson , Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier Message-ID: References: <289125.1770913057@sss.pgh.pa.us> <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: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wpSgWXW2wzIEGokS" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --wpSgWXW2wzIEGokS Content-Type: multipart/mixed; boundary="mjRLOOZbAN84hFBV" Content-Disposition: inline --mjRLOOZbAN84hFBV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. The trick in genbki.pl was needed to avoid some noise due to -Wenum-compare in a couple of files. 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. Anyway, the attached should take care of your main concern, I guess? -- Michael --mjRLOOZbAN84hFBV Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=0001-Remove-some-syscache-includes.patch Content-Transfer-Encoding: quoted-printable =46rom d5eef6cc0b96ba4bdbab1b388ca24f7a35b1e7a2 Mon Sep 17 00:00:00 2001 =46rom: Michael Paquier Date: Mon, 6 Apr 2026 08:13:46 +0900 Subject: [PATCH] Remove some syscache includes --- src/include/catalog/objectaddress.h | 2 +- src/include/utils/inval.h | 2 +- src/backend/catalog/genbki.pl | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/obje= ctaddress.h index b549be2d523e..1f965e1faef4 100644 --- a/src/include/catalog/objectaddress.h +++ b/src/include/catalog/objectaddress.h @@ -14,10 +14,10 @@ #define OBJECTADDRESS_H =20 #include "access/htup.h" +#include "catalog/syscache_ids.h" #include "nodes/parsenodes.h" #include "storage/lockdefs.h" #include "utils/relcache.h" -#include "utils/syscache.h" =20 /* * An ObjectAddress represents a database object of any type. diff --git a/src/include/utils/inval.h b/src/include/utils/inval.h index 5f64fb204776..735e42f73108 100644 --- a/src/include/utils/inval.h +++ b/src/include/utils/inval.h @@ -15,9 +15,9 @@ #define INVAL_H =20 #include "access/htup.h" +#include "catalog/syscache_ids.h" #include "storage/relfilelocator.h" #include "utils/relcache.h" -#include "utils/syscache.h" =20 extern PGDLLIMPORT int debug_discard_caches; =20 diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl index 48c6805f7527..80ef3bcd1685 100644 --- a/src/backend/catalog/genbki.pl +++ b/src/backend/catalog/genbki.pl @@ -795,7 +795,10 @@ print $fk_info "};\n\n#endif\t\t\t\t\t\t\t/* SYSTEM_FK= _INFO_H */\n"; # Now generate syscache info =20 print_boilerplate($syscache_ids_fh, "syscache_ids.h", "SysCache identifier= s"); -print $syscache_ids_fh "typedef enum SysCacheIdentifier +print $syscache_ids_fh "#ifndef SYSCACHE_IDS_H +#define SYSCACHE_IDS_H + +typedef enum SysCacheIdentifier { \tSYSCACHEID_INVALID =3D -1,\n"; =20 @@ -834,6 +837,7 @@ foreach my $syscache (sort keys %syscaches) =20 print $syscache_ids_fh "} SysCacheIdentifier;\n"; print $syscache_ids_fh "#define SysCacheSize ($last_syscache + 1)\n"; +print $syscache_ids_fh "#endif\t\t/* SYSCACHE_IDS_H */"; =20 print $syscache_info_fh "};\n"; =20 --=20 2.53.0 --mjRLOOZbAN84hFBV-- --wpSgWXW2wzIEGokS Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnS99QACgkQnvQgOdby QH1LsA/9HhJF1fRotKEwQAZ4Eq7SHQKiB9Ybmt5ikx/Qs1vG5RWyDPDbM+sbayWE exnKlj/OJvJHs2HqS/+ZqXMdyUXc0XzxxAwrHx8/7SXrC16p6N6mHuqweGN1syRm eScIhYTD6jPfoWfXKgpu/8mN9hMmSs/0hX9Ywy8nQpMR06G7KrM9T7rgqoNXS0WB D4TNBVrnCL1TAUZJA7EvNRU9skMbLOto61CwF+6iODILT933qYGj7errR2HyN8y/ WybgEy/l3x2qejueOBk/AMDU2Ko5bQv5OptKb1SoDCdcxar8FRL6Itfg83lER+L1 muFPDils4k2Vau6N70/yQqQFn9DTDOdHJBozXceBDmwV03JSwNNyGSbNvTG3Sk5c JK+FT2BKY3ANo4of5uvjiA/Md0XrrhI5CGBn0sHSHErbrwBF+tKVIfNVcbh0nXRe rzbLN69bBENsob8g26f1kD89I7WJR4qf+HW5Ldi8ixKDtRhEuvOECDHtg4yOLJa4 /W90ZaLbC+0oDk4qxkGhaHowLAwj+zusf9+g7txWHj3x+J79CiQA8gUl9pQV6UA4 Kr2z6Pig+AqdHv1cDhIPsRzOMzDSWQsiBKhMoDH/rrYm+ugmkEoR2EkBmCHm5t+H u8Qkkikhbdb2cSRp/z2qTYUprEk0rfHv2eF2h6DbK6K7V87jo8g= =ZV9e -----END PGP SIGNATURE----- --wpSgWXW2wzIEGokS--