Neil Conway <neilc@samurai.com> writes:
> This patch implements EXPLAIN EXECUTE, including documentation updates.
This seems like quite a messy way to do things. Why not just make the
grammar
ExplainStmt:
EXPLAIN opt_analyze opt_verbose OptimizableStmt
| EXPLAIN opt_analyze opt_verbose ExecuteStmt
where ExplainStmt.query can point to either an optimizable statement
or an ExecuteStmt.
Then you'd not need one single change (I think) in parsenodes.h nor
analyze.c, nor need to expose subroutines of explain.c to outside.
Instead, prepare.c would have to expose a function to fetch the plan
tree for a prepared query, but that seems a reasonable thing to do.
regards, tom lane