Re: [PATCH] Remove unused #include's in src/backend/commands/*

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Subject: Re: [PATCH] Remove unused #include's in src/backend/commands/*
Date: 2025-10-09 13:47:20
Message-ID: 202510091340.za2liige7mbm@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-10-09 14:04:16 Re: [PATCH] Remove unused #include's in src/backend/commands/*
Previous Message vignesh C 2025-10-09 13:40:32 Re: Invalid pointer access in logical decoding after error