Re: [PATCH] Remove unused #include's in src/backend/commands/* - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: [PATCH] Remove unused #include's in src/backend/commands/*
Date
Msg-id 202510091340.za2liige7mbm@alvherre.pgsql
Whole thread Raw
In response to Re: [PATCH] Remove unused #include's in src/backend/commands/*  (Aleksander Alekseev <aleksander@tigerdata.com>)
Responses Re: [PATCH] Remove unused #include's in src/backend/commands/*
List pgsql-hackers
On 2025-Oct-09, Aleksander Alekseev wrote:

> diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c
> index bb7d90aa5d9..0a8d621a373 100644
> --- a/src/backend/backup/basebackup.c
> +++ b/src/backend/backup/basebackup.c
> @@ -36,7 +36,6 @@
>  #include "postmaster/syslogger.h"
>  #include "postmaster/walsummarizer.h"
>  #include "replication/slot.h"
> -#include "replication/walsender.h"
>  #include "replication/walsender_private.h"
>  #include "storage/bufpage.h"
>  #include "storage/checksum.h"

I wonder how many of these changes pass the compilation only because the
header you're removing is indirectly being included via another header.
In this particular case, it's because slot.h includes walreceiver.h
which includes walsender.h, so this removal has no effect.

Maybe play with the script here
https://postgr.es/m/202510021240.ptc2zl5cvwen@alvherre.pgsql
to see if your changes would have any effect.  The inclusion graphs in
https://doxygen.postgresql.org may also be useful.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"La virtud es el justo medio entre dos defectos" (Aristóteles)



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Invalid pointer access in logical decoding after error
Next
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH] Remove unused #include's in src/backend/commands/*