Avoid including worker_internal.h in pgstat.h.
Amit Kapila <akapila@postgresql.org>
Avoid including worker_internal.h in pgstat.h. pgstat.h is a widely included header. Including worker_internal.h there is unnecessary and creates tight coupling. By refactoring pgstat_report_subscription_error() to fetch the required LogicalRepWorkerType internally rather than receiving it as an argument, we can eliminate the need for the internal header. Reported-by: Andres Freund <andres@anarazel.de> Author: Nisha Moond <nisha.moond412@gmail.com> Reviewed-by: vignesh C <vignesh21@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/aY-UE-4t7FiYgH3t@alap3.anarazel.de
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/functioncmds.c | modified | +1 −0 |
| src/backend/replication/logical/sequencesync.c | modified | +1 −2 |
| src/backend/replication/logical/tablesync.c | modified | +1 −2 |
| src/backend/replication/logical/worker.c | modified | +2 −4 |
| src/backend/storage/ipc/procsignal.c | modified | +1 −0 |
| src/backend/utils/activity/pgstat_subscription.c | modified | +2 −1 |
| src/include/pgstat.h | modified | +1 −3 |
| src/include/replication/worker_internal.h | modified | +7 −0 |
| src/test/modules/test_custom_stats/test_custom_var_stats.c | modified | +1 −0 |
Discussion
- pgstat include expansion 33 messages · 2026-02-13 → 2026-03-05