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/backend/commands/prepare.c | |
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/backend/commands/prepare.c')
-rw-r--r-- | src/backend/commands/prepare.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/backend/commands/prepare.c b/src/backend/commands/prepare.c index 4ee6696914..56a16401f3 100644 --- a/src/backend/commands/prepare.c +++ b/src/backend/commands/prepare.c @@ -10,7 +10,7 @@ * Copyright (c) 2002-2009, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.98 2009/07/26 23:34:17 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.99 2009/08/10 05:46:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -685,9 +685,6 @@ ExplainExecuteQuery(ExecuteStmt *execstmt, ExplainState *es, foreach(p, plan_list) { PlannedStmt *pstmt = (PlannedStmt *) lfirst(p); - bool is_last_query; - - is_last_query = (lnext(p) == NULL); if (IsA(pstmt, PlannedStmt)) { @@ -714,9 +711,9 @@ ExplainExecuteQuery(ExecuteStmt *execstmt, ExplainState *es, /* No need for CommandCounterIncrement, as ExplainOnePlan did it */ - /* put a blank line between plans */ - if (!is_last_query) - appendStringInfoChar(es->str, '\n'); + /* Separate plans with an appropriate separator */ + if (lnext(p) != NULL) + ExplainSeparatePlans(es); } if (estate) |