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.94.2) (envelope-from ) id 1uzxPB-008vAl-OQ for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Sep 2025 13:13:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uzxP9-00D3xh-5K for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Sep 2025 13:13:31 +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.94.2) (envelope-from ) id 1uzxP8-00D3xZ-L2 for pgsql-hackers@lists.postgresql.org; Sat, 20 Sep 2025 13:13:30 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uzxP5-001RiI-30 for pgsql-hackers@postgresql.org; Sat, 20 Sep 2025 13:13:29 +0000 Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id BE4CE14000AD; Sat, 20 Sep 2025 09:13:27 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Sat, 20 Sep 2025 09:13:27 -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=1758374007; x= 1758460407; bh=sfJ18A5qc49XsibJZh/xBEZVL5OfI2bvBcUe/IO2P38=; b=q oOnriha7qYeTgufFgbB8IFlwhHljtfXkdeIcghCDUuf2+ptNVvxGDWD/zX3n5gZe u881Uibj2woma0LIX0PZLtE2IXEXc5z4g1gnvZ0T+oJ0No7e/M0363VHOJr1tJQU 8dICWPaUe8MoPhRvQPG/9aM+IarbBcar1KP59N/NEkySaBBJDUXG0c1MkF9hLCgm RXfhkuVXT2eLKMU0BcETANEqn5kaoDYef0XMEsdMuX/wHFondYtIE7mLXSE40lfr zaw4wKAS59U8DnZjjPwAgaJxm5DhL1pgNGvA7g3KkVLfibaQ9O+eXUT94mjNzKth Fs6U0o5MTRa33s2+BncEA== 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=fm1; t=1758374007; x=1758460407; bh=s fJ18A5qc49XsibJZh/xBEZVL5OfI2bvBcUe/IO2P38=; b=Qs+zmXC7VL2Dgn3OO I8usI6SUk9CVlCtkGZ7u2rBYRvQou7QQ+HaBoxU/5eOrAtNuokH0WDlvXrkGX7fw H9LurQ+O7ARet5fWutRaSyQ5IFzdGUK5N6Z1tqdMfzvBJfDYNNJ4Rd0RocOfceHN lDequ0E1jLCzAt6Kw+KRy1ud9T7QuEO7n6o+C7qPEpWT/4vYm0Y+ToHlvV6dPf1M eddXG0e/KAL9J48QE7+hlD9pAWRCeKEGB6Jwg2wF0WOrDdbe+S4G15dq7fuPmgAU vZ9dl5CkRorRc4sUdY1BVPVOVHDcUIjLGR5S4x1jxHJ2InbXlPCUDAyLr5Pvk7z9 EjiBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdehvddukecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecuhfhrohhmpemllhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrf grthhtvghrnhepgedutedujeehudevveegheejgeelveevvedvuedtjedtkeeuhfehheeg vedtjeetnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges khhurhhilhgvmhhurdguvgdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgpdhrtghpthht oheprghmihhtrdhkrghpihhlrgduieesghhmrghilhdrtghomhdprhgtphhtthhopehpgh hsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopeht ghhlsehsshhsrdhpghhhrdhprgdruhhs X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 20 Sep 2025 09:13:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1758374004; bh=1Sf0LjtsGmchOQaaOlinY3FSTgDs5J+KXn6yJgjBu/0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=JxXHz1Fd3JnkRM9r/PwWYFvU+5fMIsW55dwoC+gORg0ulVEcfwpNRuiXbUCmjahtn QrFK+iNVvZo0qjfCh6MuvYg67l6LxPbcEmKmwdESe/fr27/kppbBiIeU7Ita8AcHuP 4KgA8EYu2SEx6yyv662rvMkHD+blBn6byNcPAfvAgErPDQ66fy3eDNiZI97DfQwCdz IqlSC06z9WHOPfb4+VL+SNVEacv0wGeYoEoQQpy9cllJEv/+BdXVqCkcLbmzDd5qS+ n+ubP2NAkkCAEgp63P4/XdAqgnOYwc9FMD5UaKS7+mdi9fdNBHFqdFh5DD4w2+zBVQ 64vizrvpN90wA== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 940EE71; Sat, 20 Sep 2025 15:13:24 +0200 (CEST) Date: Sat, 20 Sep 2025 15:13:24 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Tom Lane Cc: Peter Eisentraut , pgsql-hackers , Amit Kapila Subject: Re: allow benign typedef redefinitions (C11) Message-ID: <202509201308.2skq4k5wkzgu@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="mrptdtvcz3f3uhfa" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2198104.1758331044@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mrptdtvcz3f3uhfa Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2025-Sep-19, Tom Lane wrote: > Sooner or later we need to work out a subsystem hierarchy that > can define which headers should be allowed to include which > other ones. I have no clear ideas about what that should look > like, but I think the need for it gets ever more urgent. I agree, we should do that. In the meantime, it would help if people were a tiny bit more careful with what headers they add to other headers. Here's a proposed fix. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ It does it in a really, really complicated way why does it need to be complicated? Because it's MakeMaker. --mrptdtvcz3f3uhfa Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Don-t-include-execnodes.h-in-replication-conflict.h.patch" From 6a5170aea0f0c0e783b681537b077a2d7de51537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Herrera?= Date: Sat, 20 Sep 2025 15:07:58 +0200 Subject: [PATCH] Don't include execnodes.h in replication/conflict.h ... which silently propagates a lot of headers into many places via pgstat.h, as evidenced by the variety of headers that this patch needs to add to seemingly random places. Add a minimum of typedefs to conflict.h to be able to remove execnodes.h, and fix the fallout. Discussion: https://postgr.es/m/202509191927.uj2ijwmho7nv@alvherre.pgsql --- src/backend/access/transam/multixact.c | 1 + src/backend/access/transam/xlogrecovery.c | 1 + src/backend/storage/ipc/waiteventset.c | 1 + src/backend/utils/activity/pgstat_backend.c | 1 + src/include/pgstat.h | 1 + src/include/replication/conflict.h | 9 ++++++++- 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index 8bf59d369f8..9d5f130af7e 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -79,6 +79,7 @@ #include "pg_trace.h" #include "pgstat.h" #include "postmaster/autovacuum.h" +#include "storage/condition_variable.h" #include "storage/pmsignal.h" #include "storage/proc.h" #include "storage/procarray.h" diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c index 346319338a0..52ff4d119e6 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -45,6 +45,7 @@ #include "commands/tablespace.h" #include "common/file_utils.h" #include "miscadmin.h" +#include "nodes/miscnodes.h" #include "pgstat.h" #include "postmaster/bgwriter.h" #include "postmaster/startup.h" diff --git a/src/backend/storage/ipc/waiteventset.c b/src/backend/storage/ipc/waiteventset.c index 7c0e66900f9..b0746521ae4 100644 --- a/src/backend/storage/ipc/waiteventset.c +++ b/src/backend/storage/ipc/waiteventset.c @@ -67,6 +67,7 @@ #include "libpq/pqsignal.h" #include "miscadmin.h" #include "pgstat.h" +#include "port/atomics.h" #include "portability/instr_time.h" #include "postmaster/postmaster.h" #include "storage/fd.h" diff --git a/src/backend/utils/activity/pgstat_backend.c b/src/backend/utils/activity/pgstat_backend.c index 07a1116671b..a864ae8e6a6 100644 --- a/src/backend/utils/activity/pgstat_backend.c +++ b/src/backend/utils/activity/pgstat_backend.c @@ -25,6 +25,7 @@ #include "postgres.h" #include "access/xlog.h" +#include "executor/instrument.h" #include "storage/bufmgr.h" #include "storage/proc.h" #include "storage/procarray.h" diff --git a/src/include/pgstat.h b/src/include/pgstat.h index f402b17295c..e4a59a30b8c 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -11,6 +11,7 @@ #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 */ diff --git a/src/include/replication/conflict.h b/src/include/replication/conflict.h index e516caa5c73..c8fbf9e51b8 100644 --- a/src/include/replication/conflict.h +++ b/src/include/replication/conflict.h @@ -9,9 +9,16 @@ #ifndef CONFLICT_H #define CONFLICT_H -#include "nodes/execnodes.h" +#include "access/xlogdefs.h" +#include "nodes/pg_list.h" #include "utils/timestamp.h" +/* Avoid including execnodes.h here */ +typedef struct EState EState; +typedef struct ResultRelInfo ResultRelInfo; +typedef struct TupleTableSlot TupleTableSlot; + + /* * Conflict types that could occur while applying remote changes. * -- 2.47.3 --mrptdtvcz3f3uhfa--