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

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Remove unused #include's in src/backend/commands/*
Date: 2025-10-08 21:31:13
Message-ID: aObYIZWgVBP5f56G@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 08, 2025 at 09:41:30PM +0300, Aleksander Alekseev wrote:
> The main problem here is that clangd is a language server, which means
> I see errors reported by it when I open a particular file in a text
> editor. To go manually over ~2500 .c/.h files we have and then see
> what will break on CI because of an #ifdef (as it was with the patch
> v1) doesn't strike me as a great idea :)

Why not use IWYU as recommended in src/tools/pginclude/README? I gave that
a try and it didn't take very long for src/.

> Alternatively we could prioritize ~100 .c files which can be checked
> manually. Or we can make changes iteratively, as with patches v1/v2.

Excluding system headers, I'm seeing 390 suggestions for all C files in
src/, some of which I'd probably skip (e.g., snowball). That doesn't seem
too bad to me.

--
nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-10-08 21:37:03 Re: Thoughts on a "global" client configuration?
Previous Message Shayon Mukherjee 2025-10-08 21:16:12 [PATCH] Proposal: Allow reads to proceed during FK/trigger drops by reducing relation-level lock from AccessExclusive to ShareRowExclusive