Re: pgstat include expansion

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: Nisha Moond <nisha.moond412@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org, Alvaro Herrera <alvherre@kurilemu.de>, Michael Paquier <michael@paquier.xyz>
Date: 2026-02-19T06:16:03Z
Lists: pgsql-hackers
On Mon, Feb 16, 2026 at 1:18 PM Nisha Moond <nisha.moond412@gmail.com> wrote:
>
> On Sat, Feb 14, 2026 at 3:45 AM Andres Freund <andres@anarazel.de> wrote:
> >
> >
> > conflict.h includes utils/timestamp.h, even though it only needs the
> > types. Using datatype/timestamp.h suffices (although it requires some fixups
> > elsewhere).
> >
>
> It works even without including "utils/timestamp.h" in conflict.h, as
> removing this header still allows the build and full tests to pass.
> This is likely because the required definitions are included
> indirectly, as all files using conflict.h already include either
> "access/commit_ts.h" (which includes "datatype/timestamp.h") or
> "datatype/timestamp.h" itself.
>
> To avoid possible issues in the future, if conflict.h is used in a
> file that does not include timestamp.h, it would be safer to include
> "datatype/timestamp.h" directly, which is sufficient and requires no
> fixups elsewhere.
>

Yeah, that sounds better.

> The attached patch includes the required change, and make check-world
> passes cleanly for it.
>

Good. I have not tested it myself but if others don't see a problem
with this, I can do the tests and push it.

-- 
With Regards,
Amit Kapila.



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.