Re: pgstat include expansion - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pgstat include expansion
Date
Msg-id 202602280858.ypc5z67ajlf4@alvherre.pgsql
Whole thread Raw
In response to Re: pgstat include expansion  (Alvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
On 2026-Feb-27, Alvaro Herrera wrote:

> Here's one more patch.  I noticed that the call actually uses
> PG_WAIT_EXTENSION, which is in storage/wait_classes.h.  Including that
> seems a bit narrow-minded even if it's just for backwards compatibility,
> so I decided to do wait_event_types.h instead.  This is still a bit
> better than the whole wait_event.h IMO.  And also now it's IWYU: export
> rather than IWYU: keep, which seems sensible.

Actually, I think this is not a great idea, because if we do that, then
wait_event_types.h (the generated header) is, overall, included in more
files than before, so it'd be a net loss.  But if we include
wait_classes.h in latch.h instead, then that aspect is definitely much
better, and I can't find anything that gets worse.  (Any code that wants
to use other wait events can include wait_event_types.h or wait_event.h
themselves).  So I propose to close this with the attached patch.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"The important things in the world are problems with society that we don't
understand at all. The machines will become more complicated but they won't
be more complicated than the societies that run them."    (Freeman Dyson)

Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Improve checks for GUC recovery_target_xid
Next
From: Matheus Alcantara
Date:
Subject: Re: pg_upgrade fails when extension_control_path is used