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 1w8Mib-000SkD-19 for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 18:24:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8MiZ-007Ulx-2h for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 18:24: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 1w8MiZ-007Ulm-0X for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 18:24:35 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w8MiX-00000000E79-2TEr for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 18:24:34 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 8524AEC01B0; Thu, 2 Apr 2026 14:24:32 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 02 Apr 2026 14:24:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1775154272; x= 1775240672; bh=5uXkkLXUa9HOvi0DAkeUkmFY/NXN4rPK77C3bMBB0T4=; b=j CEuwy81V18rcPHntbEGtPXI1SOgDU0NtdV1gOce8qfMlYnTpaGFfYvTE7y1XvwZd zESPWznq9Igo512vU89tOOgZRa4ITu6fGVMEXgX+oMVmk1UBa5kmNT7rBvupTyTf 1EcAZdak4sP7BHv7Ddf40Mfv+I7j04yN8vTFc8weiBvWOSmHz8wvrbdPiE68Ks2b HbsN54VlpD+j6tvKWyyM51IsKqI9V1ka7JukFqFdhjU+j0+7umugsLiGN1FJwVqK 7ddCMiqT+Nmp0+/hQKVhG8b4bt9rh3uSkefwfpThp55FWs5Ue1V3k0lzX0ySNwYI nwpinlt9SvPfZlokXCuRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1775154272; x=1775240672; bh=5 uXkkLXUa9HOvi0DAkeUkmFY/NXN4rPK77C3bMBB0T4=; b=Jr+kgHKfFwVU2iXfx zYML/WKKOKZUYxOELPhYRdcR17DziKAXZuDyOqLK3Bv3WBfdFIJS8nbD405jn3yy 0wVf5Z+t/r/bewI16xUZ4tb3eujmAe5rxL7rToergaZE38wkBUWcvIKay+XOZWx6 tymi7P6rilaz5L4CMBrBmC/p/3dQUHw9Ne/P8VpiXpXKiCxSXHrjRZscatWMEbfj I2Tlyw/MPUKtt05sflWPQQoVPFd9su4LzglXgXC5+GTpgqBBGwLSmFSLtTTOI7qJ JcAP+idycoNas/mVBlf0pgwy9MyqaVODH1LmK9jTxomogc0JCZCkq3wtISJSFREw Zn1xA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdeijeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhhoucfj vghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtffrrg htthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfeffffh jeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsehk uhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopegrnhgurhgvshesrghnrghrrgiivghlrdguvgdprhgtphhtthhopehp ghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Apr 2026 14:24:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1775154269; bh=v0Up6t3q/8pnvnzDtqrK9WCQjxoyF8hQnkcsX3Sf3zs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=F5SY4churaFQcIhamYUSxNxPa3y7m8t+Fhqo8/8ZJe11alGhl/0fLKwDKy+IEtJqT x7yz1ORzPtstJmfGEgAY5G1EZrwaNy3dL/wSK4mkMcZY8ucc1f1YJO0PVFoxp6rMBx OOW7wITfjGe2BznIKgwZWxzNVnC60ui30VVKW7qWhBvZRrxuSZn+ps0M2Uop46HUwN 14FbZbU9WAjGMqiRrcJu1bIZxiLA9HSXlnTu27JKnV2klNk8153mMJUuR62/I2fW4E 9Ei+x8TH5+AkuG11GdS1zXBp7G3Wy/cHsGZXAIu1xsIwoeCagZZKOqs2QiGkcl6B0U Pqtq8Ev+8M69A== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id C78327C; Thu, 02 Apr 2026 20:24:29 +0200 (CEST) Date: Thu, 2 Apr 2026 20:24:29 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Andres Freund Cc: Pg Hackers Subject: Re: some more include removal from headers Message-ID: <202604021754.6becsqczyjci@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Apr-02, Andres Freund wrote: > I got pretty annoyed this cycle with how much rebuilding a simple change to > bufmgr.h triggers (due to hacking on it a lot). I started to write a series > to improve that, but didn't get around to posting that yet due to encountering > the issue 771fe0948ca fixed while improving the situation. > > During that I encountered the objectaddress.h include, as part of which I then > complained about the issue in [1]. Ah yeah, I noticed and was annoyed by that too. > After the attached patches, a change to bufmgr.h triggers rebuilding 213 > files, before it was 323. Not perfect, but better. > > Would be nice to get rid of the bufmgr.h includes in access/nbtree.h and such, > but it looks like that'd be a bit more work. > > I included your catalog/publication.h in it, as my version had surprisingly > extensive bitrot... I ran each patch individually under headerscheck and a full tree compile; they all pass for me. Also, each change is sensible on its own. Looking at what else includes bufmgr.h, I think the minimum it can reduced to is compiling 157 files when you change bufmgr.h, per the patches attached here. Most of them are direct inclusions, so reducing further is tough. The only one we could blame is xlogutils.h, but it needs the ReadBufferMode enum, so in order to do better, we'd have to split bufmgr.h in two. (A "fun" one is logicalproto.h being included by walreceiver.h, in turn being included by slot.h, in turn being included by logical.h, in turn being included by decode.h.) -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/