Re: moving some code out of explain.c

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: moving some code out of explain.c
Date: 2025-02-27 21:07:05
Message-ID: CA+TgmoatxYwTL1BDMZex19q3bx7UKagtG0Ro3BNi=xaV-uqnTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 27, 2025 at 3:05 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > The thing that was bugging me a bit is that explain_format.h includes
> > explain.h.
>
> Yeah, I did not like that at all either -- it makes things a bit
> circular, and I fear IWYU is going to make stupid recommendations
> like not including explain.h in explain.c.
>
> Did you look at avoiding that with our standard trick of writing
> detail-free struct declarations? That is, explain_format.h
> would need
>
> struct ExplainState; /* avoid including explain.h here */
>
> and then s/ExplainState/struct ExplainState/ in all the function
> declarations. You'd still need to get List from someplace, but
> it could be gotten by including primnodes.h or even pg_list.h.

OK, here's a patch that does that. Thoughts?

--
Robert Haas
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
v1-0001-Avoid-including-commands-explain.h-in-commands-ex.patch application/octet-stream 3.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-02-27 21:08:12 Re: [PROPOSAL] : Disallow use of empty column name in (column_name '') in ALTER or CREATE of foreign table.
Previous Message Corey Huinker 2025-02-27 20:50:21 Re: Statistics Import and Export commit related issue.