summaryrefslogtreecommitdiff
path: root/src/include/commands
diff options
context:
space:
mode:
authorRobert Haas2025-02-27 17:37:10 +0000
committerRobert Haas2025-02-27 17:37:10 +0000
commit9173e8b604636633a8e3aca54bb56a437bffa718 (patch)
tree3d2ab9fea6b2bf5586da2b7e9dc5c10af0e82041 /src/include/commands
parent95dbd827f2edc4d10bebd7e840a0bd6782cf69b7 (diff)
Create explain_format.c and move relevant code there.
explain.c has grown rather large, so move various functions that are principally concerned with output generation to a new source file, explain_format.c, instead of lumping them in with everything else that is part of explain.c Reviewed-by: Peter Geoghegan <[email protected]> Discussion: http://postgr.es/m/CA+TgmoYutMw1Jgo8BWUmB3TqnOhsEAJiYO=rOQufF4gPLWmkLQ@mail.gmail.com
Diffstat (limited to 'src/include/commands')
-rw-r--r--src/include/commands/explain.h24
-rw-r--r--src/include/commands/explain_format.h52
2 files changed, 52 insertions, 24 deletions
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h
index 570e7cad1fa..8dd87c47eec 100644
--- a/src/include/commands/explain.h
+++ b/src/include/commands/explain.h
@@ -120,30 +120,6 @@ extern void ExplainPrintJITSummary(ExplainState *es, QueryDesc *queryDesc);
extern void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc);
extern void ExplainQueryParameters(ExplainState *es, ParamListInfo params, int maxlen);
-extern void ExplainBeginOutput(ExplainState *es);
-extern void ExplainEndOutput(ExplainState *es);
-extern void ExplainSeparatePlans(ExplainState *es);
-
-extern void ExplainPropertyList(const char *qlabel, List *data,
- ExplainState *es);
-extern void ExplainPropertyListNested(const char *qlabel, List *data,
- ExplainState *es);
-extern void ExplainPropertyText(const char *qlabel, const char *value,
- ExplainState *es);
-extern void ExplainPropertyInteger(const char *qlabel, const char *unit,
- int64 value, ExplainState *es);
-extern void ExplainPropertyUInteger(const char *qlabel, const char *unit,
- uint64 value, ExplainState *es);
-extern void ExplainPropertyFloat(const char *qlabel, const char *unit,
- double value, int ndigits, ExplainState *es);
-extern void ExplainPropertyBool(const char *qlabel, bool value,
- ExplainState *es);
-
-extern void ExplainOpenGroup(const char *objtype, const char *labelname,
- bool labeled, ExplainState *es);
-extern void ExplainCloseGroup(const char *objtype, const char *labelname,
- bool labeled, ExplainState *es);
-
extern DestReceiver *CreateExplainSerializeDestReceiver(ExplainState *es);
#endif /* EXPLAIN_H */
diff --git a/src/include/commands/explain_format.h b/src/include/commands/explain_format.h
new file mode 100644
index 00000000000..0460f0fd2af
--- /dev/null
+++ b/src/include/commands/explain_format.h
@@ -0,0 +1,52 @@
+/*-------------------------------------------------------------------------
+ *
+ * explain_format.h
+ * prototypes for explain_format.c
+ *
+ * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994-5, Regents of the University of California
+ *
+ * src/include/commands/explain_format.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef EXPLAIN_FORMAT_H
+#define EXPLAIN_FORMAT_H
+
+#include "commands/explain.h"
+
+extern void ExplainPropertyList(const char *qlabel, List *data,
+ ExplainState *es);
+extern void ExplainPropertyListNested(const char *qlabel, List *data,
+ ExplainState *es);
+extern void ExplainPropertyText(const char *qlabel, const char *value,
+ ExplainState *es);
+extern void ExplainPropertyInteger(const char *qlabel, const char *unit,
+ int64 value, ExplainState *es);
+extern void ExplainPropertyUInteger(const char *qlabel, const char *unit,
+ uint64 value, ExplainState *es);
+extern void ExplainPropertyFloat(const char *qlabel, const char *unit,
+ double value, int ndigits, ExplainState *es);
+extern void ExplainPropertyBool(const char *qlabel, bool value,
+ ExplainState *es);
+
+extern void ExplainOpenGroup(const char *objtype, const char *labelname,
+ bool labeled, ExplainState *es);
+extern void ExplainCloseGroup(const char *objtype, const char *labelname,
+ bool labeled, ExplainState *es);
+
+extern void ExplainOpenSetAsideGroup(const char *objtype, const char *labelname,
+ bool labeled, int depth, ExplainState *es);
+extern void ExplainSaveGroup(ExplainState *es, int depth, int *state_save);
+extern void ExplainRestoreGroup(ExplainState *es, int depth, int *state_save);
+
+extern void ExplainDummyGroup(const char *objtype, const char *labelname,
+ ExplainState *es);
+
+extern void ExplainBeginOutput(ExplainState *es);
+extern void ExplainEndOutput(ExplainState *es);
+extern void ExplainSeparatePlans(ExplainState *es);
+
+extern void ExplainIndentText(ExplainState *es);
+
+#endif