Re: pgstat include expansion
Álvaro Herrera <alvherre@kurilemu.de>
From: Alvaro Herrera <alvherre@kurilemu.de>
To: Andres Freund <andres@anarazel.de>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, pgsql-hackers@postgresql.org, Amit Kapila <amit.kapila16@gmail.com>, Michael Paquier <michael@paquier.xyz>
Date: 2026-03-05T15:08:27Z
Lists: pgsql-hackers
Attachments
- v2-0001-Don-t-include-wait_event.h-in-pgstat.h.patch (text/x-diff)
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)
Commits
-
Don't include wait_event.h in pgstat.h
- 868825aaeb40 19 (unreleased) landed
-
Don't include proc.h in shm_mq.h
- a2c89835f512 19 (unreleased) landed
-
Don't include latch.h in libpq/libpq.h
- 7b9b620d8fc7 19 (unreleased) landed
-
Reduce includes in pgstat.h
- 7bb50dd7d6b9 19 (unreleased) landed
-
Avoid including utils/timestamp.h in conflict.h.
- 308622edf174 19 (unreleased) landed
-
Avoid including worker_internal.h in pgstat.h.
- 9842e8aca096 19 (unreleased) landed
-
Add seq_sync_error_count to subscription statistics.
- f6a4c498dcf6 19 (unreleased) cited
-
Don't include execnodes.h in replication/conflict.h
- 7e638d7f5093 19 (unreleased) cited
-
Collect statistics about conflicts in logical replication.
- 6c2b5edecc0d 18.0 cited