Re: moving some code out of explain.c

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Álvaro Herrera <alvherre@alvh.no-ip.org>, Peter Geoghegan <pg@bowt.ie>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Andrew Dunstan <andrew@dunslane.net>
Date: 2025-02-27T21:25:39Z
Lists: pgsql-hackers

Attachments

On Thu, Feb 27, 2025 at 4:12 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> +1, but how about explain_dr.h too?  It doesn't seem though that
> we can avoid #include "executor/instrument.h" there, so it'd be
> a little asymmetrical.  But the executor inclusion doesn't seem
> nearly as much almost-circular.

OK, here is v2. One slightly unfortunate thing about this is that we
end up with a line that is over 80 characters:

extern DestReceiver *CreateExplainSerializeDestReceiver(struct
ExplainState *es);

Aside from perhaps shortening the function name, I don't see how to avoid that.

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

Commits

  1. Avoid including explain.h in explain_format.h and explain_dr.h

  2. Create explain_dr.c and move DestReceiver-related code there.

  3. Create explain_format.c and move relevant code there.