Re: moving some code out of explain.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: moving some code out of explain.c
Date
Msg-id 2612294.1740686754@sss.pgh.pa.us
Whole thread Raw
In response to Re: moving some code out of explain.c  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: moving some code out of explain.c
List pgsql-hackers
Robert Haas <robertmhaas@gmail.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.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: SQLFunctionCache and generic plans
Next
From: Tom Lane
Date:
Subject: Re: SQLFunctionCache and generic plans