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

From Tom Lane
Subject Re: [PATCH] Remove unused #include's in src/backend/commands/*
Date
Msg-id 2955415.1760024686@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Remove unused #include's in src/backend/commands/*  (Álvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> On 2025-Oct-09, Aleksander Alekseev wrote:
>> 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.

> It isn't, but the fact that the source is not actually improved in any
> way makes the change irrelevant.

Maybe I shouldn't put words in Álvaro's mouth, but I think the reason
you're getting so much pushback from senior hackers is that we
remember some very bad experiences with automated #include-removal
years ago --- particularly 1609797c2, which turned me for one off the
idea altogether.  The currently available tools are probably smarter
than what we were using back then, but they're evidently still not
perfect, and we're leery of having to undo work.

I think the issues you're hitting right now may stem from not
compiling with all available options.  Notably, if you don't have
--enable-cassert turned on, there's a pretty fair amount of code
you might be failing to account for.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: compiling pg_bsd_indent
Next
From: Andres Freund
Date:
Subject: Re: Adding some error context for lock wait failures