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 1vve5H-00BkFi-2X for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 16:19:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vve5G-00E836-2R for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 16:19:26 +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 1vve5G-00E82u-0t for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 16:19:26 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vve5C-00000001KJ7-38PU for pgsql-hackers@postgresql.org; Thu, 26 Feb 2026 16:19:25 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id E6BCFEC0640; Thu, 26 Feb 2026 11:19:22 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Thu, 26 Feb 2026 11:19:22 -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=1772122762; x= 1772209162; bh=iR4hXn8ZA7x4qjV0/qKG1Ba8/6cprEA7UnOTbpw0NMk=; b=e Q3v+pbHXLmDxI9DXuKY0CLpsW4BcquCnyghU6HhpUpi1ENiAC7sexg/ghaRNATYc jIyLF09rKV5X4NnUAD/1bLzOOe4Ucqc6XjD9emHn+IJ7l3x5QqjErI3UdJEpwcDH ivBe962k30jl6ZbLgVHAMkBPL21oTEZa4+j2BRc4MsMcop8EVfAHNppGR+TsAceK PNAX1MyUpKuA+nA/PhPXW2ylFu1PJPAHO2ng/n6Bj8S/i6gP9wrzPkZwygfxyJPB e5aTp5nxfGLYZzRwniVAPyaaKDZlSS/vACUAF2BoMN0DXUHH19V4ZP1SqR7pOUPo 5bAhqAMY3shLsw8UpYJSg== 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=1772122762; x=1772209162; bh=i R4hXn8ZA7x4qjV0/qKG1Ba8/6cprEA7UnOTbpw0NMk=; b=H4fM5AyDoqt7XMLPh Qq0usddsZzfvWAVjB2HmqGrMOihRnDGrkpFdHWIKoizylL9Fptl0l99lGTDDtsy6 ndpWFggRtIcJoVq0DY0mk1o+diS89KnwPRpvtLp7XkqXeHGUGUyCjjqoHm2KlK3Q /50wvZQQ4BO3C4qA2WJ+aGDIhi7dm1Ib7gs1ZPlEerm2zQ+XkXU7K7cdS5H85JxM j0Kj5aehtYEFZcO7qjGwDUZuT/7wfLoUM7nW9fPioyDYUhS+qg6/BOunanY1xwTV 8Z81lLteN0obJBCjhY+pYjagPDxtRGjnuMKc8CfuE+HKhg1k8f3jTK5gyU/+y9NH mD7Qg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgeeihedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesmhekreertddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetkedujedutedtiefgteejgedtffefueetffegfffhgffgleelhfff jedtheefvdenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopegrnhgurhgvshesrghnrghrrgiivghlrdguvgdprhgtphhtthho pegrmhhithdrkhgrphhilhgrudeisehgmhgrihhlrdgtohhmpdhrtghpthhtohephhhlih hnnhgrkhgrsehikhhirdhfihdprhgtphhtthhopehmihgthhgrvghlsehprghquhhivghr rdighiiipdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqh hlrdhorhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Feb 2026 11:19:22 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1772122760; bh=8EF0Rlg+3rY3LTV2N2+Q++yjyE7ob0MoKxq+iFJut7k=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Kq+5bmOFOfBxu8Na4bNb7A86ACYhWvwTXPSgAlHw1VVugR2GwsOerMvEJdHBb9gZk Q1HYbdtk/BF2Do19hAblW+sjyz9gyorp8yF1wr3mXxiRi5IHZuL0sYLSetjvMHq6QD /IpEchb0zXvmh5ugYjP6U96wSca8xOaxhz+6znrm4LDiaZ6DqXqOLMvaDJdf0kA43l kloxz8oy7RSciuJx+T0OHt5Tdj4MzgLCzKutVzwuQDmrTfMMICvt4Jk5XKZOmJS4+s K4FLL6wjoUQkBpgdVTVlERgET2YNXMkX1QuiXSblyhyl+QhxxQcWV204lXjTRXXJhN WWJ5gHniW6NCw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 2C0377A; Thu, 26 Feb 2026 17:19:20 +0100 (CET) Date: Thu, 26 Feb 2026 17:19:20 +0100 From: Alvaro Herrera To: Andres Freund Cc: Heikki Linnakangas , pgsql-hackers@postgresql.org, Amit Kapila , Michael Paquier Subject: Re: pgstat include expansion Message-ID: <202602261618.manjpfqcmp66@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3wncsjogfzdqdxu6" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202602261523.yu3fs2tpzszl@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --3wncsjogfzdqdxu6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2026-Feb-26, Alvaro Herrera wrote: > However, maybe we can just not be so principled about it, add it to > latch.h, and then we don't break the whole world. I'll try that. This one does it that way. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Cuando mañana llegue pelearemos segun lo que mañana exija" (Mowgli) --3wncsjogfzdqdxu6 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v3-0001-Don-t-include-wait_event.h-in-pgstat.h.patch" From 716ff1063aa274c1bfcff83515da8d706c03e657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Herrera?= Date: Thu, 26 Feb 2026 17:15:22 +0100 Subject: [PATCH v3] Don't include wait_event.h in pgstat.h Avoid breaking too much third-party code by including wait_events.h in latch.h; this makes sense anyway, because many extension do WaitLatch() using a wait event value. Discussion: https://postgr.es/m/202602181214.gcmhx2vhlxzp@alvherre.pgsql --- src/backend/access/transam/slru.c | 1 + src/backend/access/transam/timeline.c | 1 + src/backend/access/transam/xlogarchive.c | 1 + src/backend/access/transam/xlogreader.c | 1 + src/backend/archive/shell_archive.c | 1 + src/backend/backup/basebackup.c | 1 + src/backend/replication/logical/origin.c | 1 + src/backend/storage/file/buffile.c | 1 + src/backend/storage/file/copydir.c | 1 + src/backend/storage/file/fd.c | 1 + src/backend/storage/ipc/dsm_impl.c | 1 + src/backend/storage/smgr/md.c | 1 + src/backend/utils/cache/relmapper.c | 1 + src/common/controldata_utils.c | 1 + src/include/pgstat.h | 1 - src/include/storage/latch.h | 1 + 16 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index 549c7e3e64b..556edcbf7cb 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -71,6 +71,7 @@ #include "storage/fd.h" #include "storage/shmem.h" #include "utils/guc.h" +#include "utils/wait_event.h" /* * Converts segment number to the filename of the segment. diff --git a/src/backend/access/transam/timeline.c b/src/backend/access/transam/timeline.c index 60ee28665b1..68e5f692d26 100644 --- a/src/backend/access/transam/timeline.c +++ b/src/backend/access/transam/timeline.c @@ -41,6 +41,7 @@ #include "access/xlogdefs.h" #include "pgstat.h" #include "storage/fd.h" +#include "utils/wait_event.h" /* * Copies all timeline history files with id's between 'begin' and 'end' diff --git a/src/backend/access/transam/xlogarchive.c b/src/backend/access/transam/xlogarchive.c index aa0c2fe3afd..9a0c8097cb1 100644 --- a/src/backend/access/transam/xlogarchive.c +++ b/src/backend/access/transam/xlogarchive.c @@ -31,6 +31,7 @@ #include "replication/walsender.h" #include "storage/fd.h" #include "storage/ipc.h" +#include "utils/wait_event.h" /* * Attempt to retrieve the specified file from off-line archival storage. diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c index 03ada8aa0c5..8cb2110cb99 100644 --- a/src/backend/access/transam/xlogreader.c +++ b/src/backend/access/transam/xlogreader.c @@ -36,6 +36,7 @@ #ifndef FRONTEND #include "pgstat.h" #include "storage/bufmgr.h" +#include "utils/wait_event.h" #else #include "common/logging.h" #endif diff --git a/src/backend/archive/shell_archive.c b/src/backend/archive/shell_archive.c index 5b565968818..0b427a68809 100644 --- a/src/backend/archive/shell_archive.c +++ b/src/backend/archive/shell_archive.c @@ -22,6 +22,7 @@ #include "archive/shell_archive.h" #include "common/percentrepl.h" #include "pgstat.h" +#include "utils/wait_event.h" static bool shell_archive_configured(ArchiveModuleState *state); static bool shell_archive_file(ArchiveModuleState *state, diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c index 2d74c648335..ab1fbae8001 100644 --- a/src/backend/backup/basebackup.c +++ b/src/backend/backup/basebackup.c @@ -48,6 +48,7 @@ #include "utils/ps_status.h" #include "utils/relcache.h" #include "utils/resowner.h" +#include "utils/wait_event.h" /* * How much data do we want to send in one CopyData message? Note that diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c index c3271a6fd0e..26afd8f0af9 100644 --- a/src/backend/replication/logical/origin.c +++ b/src/backend/replication/logical/origin.c @@ -95,6 +95,7 @@ #include "utils/rel.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/wait_event.h" /* paths for replication origin checkpoint files */ #define PG_REPLORIGIN_CHECKPOINT_FILENAME PG_LOGICAL_DIR "/replorigin_checkpoint" diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c index ddf3a410d6f..c4afe4d368a 100644 --- a/src/backend/storage/file/buffile.c +++ b/src/backend/storage/file/buffile.c @@ -53,6 +53,7 @@ #include "storage/bufmgr.h" #include "storage/fd.h" #include "utils/resowner.h" +#include "utils/wait_event.h" /* * We break BufFiles into gigabyte-sized segments, regardless of RELSEG_SIZE. diff --git a/src/backend/storage/file/copydir.c b/src/backend/storage/file/copydir.c index 596d9070fd8..5ee141f13a5 100644 --- a/src/backend/storage/file/copydir.c +++ b/src/backend/storage/file/copydir.c @@ -29,6 +29,7 @@ #include "pgstat.h" #include "storage/copydir.h" #include "storage/fd.h" +#include "utils/wait_event.h" /* GUCs */ int file_copy_method = FILE_COPY_METHOD_COPY; diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 5d07b64a1ef..01f1bd6e687 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -101,6 +101,7 @@ #include "utils/guc_hooks.h" #include "utils/resowner.h" #include "utils/varlena.h" +#include "utils/wait_event.h" /* Define PG_FLUSH_DATA_WORKS if we have an implementation for pg_flush_data */ #if defined(HAVE_SYNC_FILE_RANGE) diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c index e208457df27..e8c07805f59 100644 --- a/src/backend/storage/ipc/dsm_impl.c +++ b/src/backend/storage/ipc/dsm_impl.c @@ -68,6 +68,7 @@ #include "storage/fd.h" #include "utils/guc.h" #include "utils/memutils.h" +#include "utils/wait_event.h" #ifdef USE_DSM_POSIX static bool dsm_impl_posix(dsm_op op, dsm_handle handle, Size request_size, diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 443434e4ea8..dee29037b16 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -40,6 +40,7 @@ #include "storage/smgr.h" #include "storage/sync.h" #include "utils/memutils.h" +#include "utils/wait_event.h" /* * The magnetic disk storage manager keeps track of open file diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c index 778b14a2318..3aaf466868d 100644 --- a/src/backend/utils/cache/relmapper.c +++ b/src/backend/utils/cache/relmapper.c @@ -54,6 +54,7 @@ #include "storage/lwlock.h" #include "utils/inval.h" #include "utils/relmapper.h" +#include "utils/wait_event.h" /* diff --git a/src/common/controldata_utils.c b/src/common/controldata_utils.c index 14530c6489a..4ab116afcde 100644 --- a/src/common/controldata_utils.c +++ b/src/common/controldata_utils.c @@ -37,6 +37,7 @@ #ifndef FRONTEND #include "pgstat.h" #include "storage/fd.h" +#include "utils/wait_event.h" #endif /* diff --git a/src/include/pgstat.h b/src/include/pgstat.h index 0e9d2b4c623..216b93492ba 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -18,7 +18,6 @@ #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/wait_event.h" /* for backward compatibility */ /* IWYU pragma: export */ /* avoid including access/transam.h */ diff --git a/src/include/storage/latch.h b/src/include/storage/latch.h index fbdadc86959..cbefc7ed154 100644 --- a/src/include/storage/latch.h +++ b/src/include/storage/latch.h @@ -104,6 +104,7 @@ #include #include "storage/waiteventset.h" /* for WL_* arguments to WaitLatch */ +#include "utils/wait_event.h" /* IWYU pragma: export */ /* * Latch structure should be treated as opaque and only accessed through -- 2.47.3 --3wncsjogfzdqdxu6--