Re: pgstat include expansion

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Chao Li <li.evan.chao@gmail.com>, Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org, Alvaro Herrera <alvherre@kurilemu.de>
Date: 2026-02-16T07:59:49Z
Lists: pgsql-hackers
On Mon, Feb 16, 2026 at 11:05:41AM +0530, Amit Kapila wrote:
> How about moving LogicalRepWorkerType to logicalworker.h as in the
> attached and then include that in pgstat.h? This requires few other
> adjustments as previously some of the includes were working indirectly
> via worker_internal.h.

Yep, this feels much cleaner.  I am not sure we really need to limit
LogicalRepWorkerType to be in an internal header knowing that it is
exposed in the pgstat layer.
--
Michael

Commits

  1. Don't include wait_event.h in pgstat.h

  2. Don't include proc.h in shm_mq.h

  3. Don't include latch.h in libpq/libpq.h

  4. Reduce includes in pgstat.h

  5. Avoid including utils/timestamp.h in conflict.h.

  6. Avoid including worker_internal.h in pgstat.h.

  7. Add seq_sync_error_count to subscription statistics.

  8. Don't include execnodes.h in replication/conflict.h

  9. Collect statistics about conflicts in logical replication.