Make it possible for loadable modules to add EXPLAIN options. Modules can use RegisterExtensionExplainOption to register new EXPLAIN options, and GetExplainExtensionId, GetExplainExtensionState, and SetExplainExtensionState to store related state inside the ExplainState object.
Since this substantially increases the amount of code that needs to handle ExplainState-related tasks, move a few bits of existing code to a new file explain_state.c and add the rest of this infrastructure there. See the comments at the top of explain_state.c for further explanation of how this mechanism works. This does not yet provide a way for such such options to do anything useful. The intention is that we'll add hooks for that purpose in a separate commit. Discussion: http://postgr.es/m/ca+tgmoyszg58hpubmei46o8d3skx+szoo4k_agqgwirzvra...@mail.gmail.com Reviewed-by: Srinath Reddy <srinath2...@gmail.com> Reviewed-by: Andrei Lepikhov <lepi...@gmail.com> Reviewed-by: Tom Lane <t...@sss.pgh.pa.us> Reviewed-by: Sami Imseih <samims...@gmail.com> Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c65bc2e1d14a2d4daed7c1921ac518f2c5ac3d17 Modified Files -------------- contrib/auto_explain/auto_explain.c | 1 + contrib/file_fdw/file_fdw.c | 3 +- contrib/postgres_fdw/postgres_fdw.c | 2 +- src/backend/commands/Makefile | 1 + src/backend/commands/createas.c | 2 + src/backend/commands/explain.c | 143 +------------ src/backend/commands/explain_dr.c | 1 + src/backend/commands/explain_format.c | 1 + src/backend/commands/explain_state.c | 371 ++++++++++++++++++++++++++++++++++ src/backend/commands/meson.build | 1 + src/backend/commands/prepare.c | 2 + src/backend/executor/execAmi.c | 1 + src/backend/tcop/pquery.c | 1 + src/include/commands/explain.h | 80 ++------ src/include/commands/explain_state.h | 95 +++++++++ src/include/commands/prepare.h | 3 +- src/include/nodes/extensible.h | 2 +- src/tools/pgindent/typedefs.list | 2 + 18 files changed, 503 insertions(+), 209 deletions(-)