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

From: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, 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 15:08:39
Message-ID: CAJ7c6TP1E5RcEbPLoM7bBpqfiscL1147CzTADDO1P9qt5ftJDQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Álvaro,

> 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.

Hm.... on the flip side if the file is already included what's the
point in the second #include? It doesn't do anything and is redundant,
isn't it? At least my text editor highlights it as such (because
clangd tells it so). This is not a huge problem of course, just a bit
distracting.

If the idea is to always have an explicit list of all the includes (no
indirect ones) I think we may end up with pretty long lists, and I
don't instantly see value in this to be honest.

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-10-09 15:09:07 Re: Thoughts on a "global" client configuration?
Previous Message Sami Imseih 2025-10-09 15:07:17 Re: Add mode column to pg_stat_progress_vacuum