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 1vs1J6-000waB-2E for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 16:18:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vs1J5-003swW-1Z for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 16:18:43 +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 1vs1J4-003svr-2p for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 16:18:43 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vs1J2-000000012zv-0pvf for pgsql-hackers@postgresql.org; Mon, 16 Feb 2026 16:18:42 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 36AB5EC0776; Mon, 16 Feb 2026 11:18:38 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Mon, 16 Feb 2026 11:18:38 -0500 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=fm2; t=1771258718; x= 1771345118; bh=JXzcQoE5NOC8AzAEcsxiTiTsaGMw3MsloGS1ps4HNF4=; b=j Cd+wpIK1yaNUJfKBeLyq4S/noTE/1l1Mm2JC+UJu0f4NmVPWwxQxKmW5fy4tVRGk 5x60GGvQR57QLwj6YeK3z7XByXuC9oTBf17ET00zLwIcyiE4lLwJicoOtAePHDO+ D0kFJtPKn82aEVSBjCrpV+0q4kl47A3Q6urC+38mqhIaP+LfDWm8IlCLSEY80n54 juqgIw4ul1Xv8uyQUud6UgR2Nm+t51t5eRaMlksGSZeoQyZRMfLzzfM//yexWGp4 r3pdDU0MTpSJVn8ZupxFmi2RVxXr1bcuqwHlK+QNi5gDSQJBQm5jVqDoo5SmhykQ uFOiGYr/sTbUbZxndt1xA== 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=fm3; t=1771258718; x=1771345118; bh=J XzcQoE5NOC8AzAEcsxiTiTsaGMw3MsloGS1ps4HNF4=; b=fmpyH7qW3T7NCCSG8 fCqner/pqus6lO0m9NrmUUsjKCb2e43PyulqC9RLE0E3WbVvx6La3mnhIBtyoSp9 yEh3wfxFhBtQdC0rfV9dklDL0g38iSJbWp1acnEKAkIQTEDmmmLsn41GCDg6dj+L AAgQVzvLvGt355VjAAGxmBhsbdN8tMjpmnBhhQNxFwvSGAFmFwXEDBWWmVr/YKIp ynzNgczfd5YYkuQQZtJXN4JFFs567F/vWQ/8JswTi8WIPqcKX8TobvuDnZrKu4gh sChbGpJan27ciAXluq3OkYC+1o4xNakwvFCbWUC7F22LwHEi1eWFIJTibU3WZZtJ DAjZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvudejfeefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeehuddutedtleejgeeiudeutefguedvfffhtdfhudetffdvhfekveei kedugeetleenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmpdhpohhsth hgrhdrvghsnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheprghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeegpd hmohguvgepshhmthhpohhuthdprhgtphhtthhopegrnhgurhgvshesrghnrghrrgiivghl rdguvgdprhgtphhtthhopegrmhhithdrkhgrphhilhgrudeisehgmhgrihhlrdgtohhmpd hrtghpthhtohepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidprhgtphhtthhopehp ghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Feb 2026 11:18:37 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1771258716; bh=pM+AXyKocCID8qcQ+aefwuvu/dJPPoogqBDvuK4oqrU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=1Eq/nUQdQEEDJFjCMUS/3H+x88vNbXYS/wA8QY9SvR3UVemFlEzdmv2MCuP4WgMBG 6XkGnOLYbXqbx03UpzB4InJg+NJrMRwwa3fWN6/LKSW7FMHEY8J6UkuHpYe9lJ0DaE 2I7VX65nw1hMQwjimwgxBrRYdSn7UHKzVoKme+DuEttNt32Q9TNUZjFQlOvOCBWYDz aG2Vh9QB037Gi7nM2cCH9e2QmhfI99k78qFbyhbWeE9X3GA8Oac6fjlDftM0RuF3AG TlZEFasjJRvPQpGpqaa2RkS9TTTKJss8vVE5DS6BWA3LtReMhxSfeeMntNyHX64Uzg HWC2srDWNHkRA== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 22B8E7A; Mon, 16 Feb 2026 17:18:36 +0100 (CET) Date: Mon, 16 Feb 2026 17:18:36 +0100 From: Alvaro Herrera To: Andres Freund Cc: pgsql-hackers@postgresql.org, Amit Kapila , Michael Paquier Subject: Re: pgstat include expansion Message-ID: <202602161556.jvzstcqqsxq5@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-Feb-13, Andres Freund wrote: > commit 7e638d7f509 > Author: Álvaro Herrera > Date: 2025-09-25 14:45:08 +0200 > > Don't include execnodes.h in replication/conflict.h > > added an include of access/transam.h, which I don't love being included, > although it's less bad than some of the other cases. It's not actually to > blame for that though, as it shrank what was included noticeably. > diff --git a/src/include/pgstat.h b/src/include/pgstat.h > index fff7ecc2533..a2021a0e66f 100644 > --- a/src/include/pgstat.h > +++ b/src/include/pgstat.h > @@ -11,18 +11,20 @@ > #ifndef PGSTAT_H > #define PGSTAT_H > > -#include "access/transam.h" /* for FullTransactionId */ > #include "datatype/timestamp.h" > #include "portability/instr_time.h" > #include "postmaster/pgarch.h" /* for MAX_XFN_CHARS */ > -#include "replication/conflict.h" > -#include "replication/worker_internal.h" > +#include "replication/conflict.h" /* for CONFLICT_NUM_TYPES */ > #include "utils/backend_progress.h" /* for backward compatibility */ /* IWYU pragma: export */ > #include "utils/backend_status.h" /* for backward compatibility */ /* IWYU pragma: export */ > #include "utils/pgstat_kind.h" > -#include "utils/relcache.h" > #include "utils/wait_event.h" /* for backward compatibility */ /* IWYU pragma: export */ > > +/* to avoid including access/transam.h, for FullTransactionId */ > +typedef struct FullTransactionId FullTransactionId; > + > +/* to avoid including utils/relcache.h */ > +typedef struct RelationData *Relation; > > /* ---------- > * Paths for the statistics files (relative to installation's $PGDATA). Yeah, I intended not to add access/transam.h here and instead forward-declare FullTransactionId, but forgot to actually remove it before pushing. So +1 for what you're doing here with that. Same with relcache.h and most of the other changes you're doing here. I don't think the removal of pg_list.h works terribly well though, as that is something that I would expect to be pretty much everywhere, so it seems somewhat pointless to try to avoid it in this file. I'm not very sure what to do about LogicalRepWorkerType ... will follow-up to Amit's reply. I think we should in addition remove some includes that were kept during recent IWYU hacking "for backwards compatibility", and instead include them explicitly wherever they are needed. The attached does that. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "You're _really_ hosed if the person doing the hiring doesn't understand relational systems: you end up with a whole raft of programmers, none of whom has had a Date with the clue stick." (Andrew Sullivan) https://postgr.es/m/20050809113420.GD2768@phlogiston.dyndns.org