diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-10 05:46:50 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-10 05:46:50 +0000 |
| commit | 9bd27b7c9e998087f390774bd0f43916813a2847 (patch) | |
| tree | ee2b7fa2b2e77c53c87a53a786163dae1b0e6538 /src/include/commands/explain.h | |
| parent | 18894c401f1f5ec5af1d08a12da1f183599e8560 (diff) | |
| download | postgresql-9bd27b7c9e998087f390774bd0f43916813a2847.tar.gz | |
Extend EXPLAIN to support output in XML or JSON format.
There are probably still some adjustments to be made in the details
of the output, but this gets the basic structure in place.
Robert Haas
Diffstat (limited to 'src/include/commands/explain.h')
| -rw-r--r-- | src/include/commands/explain.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h index a5cc40367f..fa2c8aac66 100644 --- a/src/include/commands/explain.h +++ b/src/include/commands/explain.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.40 2009/07/26 23:34:18 tgl Exp $ + * $PostgreSQL: pgsql/src/include/commands/explain.h,v 1.41 2009/08/10 05:46:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -15,16 +15,26 @@ #include "executor/executor.h" +typedef enum ExplainFormat +{ + EXPLAIN_FORMAT_TEXT, + EXPLAIN_FORMAT_XML, + EXPLAIN_FORMAT_JSON +} ExplainFormat; + typedef struct ExplainState { StringInfo str; /* output buffer */ /* options */ - bool verbose; /* print plan targetlists */ + bool verbose; /* be verbose */ bool analyze; /* print actual times */ bool costs; /* print costs */ + ExplainFormat format; /* output format */ /* other states */ PlannedStmt *pstmt; /* top of plan */ List *rtable; /* range table */ + int indent; /* current indentation level */ + List *grouping_stack; /* format-specific grouping state */ } ExplainState; /* Hook for plugins to get control in ExplainOneQuery() */ @@ -54,4 +64,6 @@ extern void ExplainOnePlan(PlannedStmt *plannedstmt, ExplainState *es, extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc); +extern void ExplainSeparatePlans(ExplainState *es); + #endif /* EXPLAIN_H */ |
