Avoid including worker_internal.h in pgstat.h.

Amit Kapila <akapila@postgresql.org>

Commit: 9842e8aca096d9b988a3ae924cdf4aa7e1bb2ea2
Author: Amit Kapila <akapila@postgresql.org>
Date: 2026-02-20T03:56:33Z
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

Discussion