aboutsummaryrefslogtreecommitdiff
path: root/contrib/auto_explain/auto_explain.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2010-02-16 22:19:59 +0000
committerAndrew Dunstan <andrew@dunslane.net>2010-02-16 22:19:59 +0000
commitfc5173ad514a216dc93bc190dbba3751024a257d (patch)
tree6aef7769d8f91882752a786a03e894615274ebd8 /contrib/auto_explain/auto_explain.c
parent56adf3703c77295b63a71a42e602df247132e409 (diff)
downloadpostgresql-fc5173ad514a216dc93bc190dbba3751024a257d.tar.gz
postgresql-fc5173ad514a216dc93bc190dbba3751024a257d.zip
Add query text to auto_explain output.
Still to be done: fix docs and fix regression failures under auto_explain.
Diffstat (limited to 'contrib/auto_explain/auto_explain.c')
-rw-r--r--contrib/auto_explain/auto_explain.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/auto_explain/auto_explain.c b/contrib/auto_explain/auto_explain.c
index a57cd162153..61406db6342 100644
--- a/contrib/auto_explain/auto_explain.c
+++ b/contrib/auto_explain/auto_explain.c
@@ -6,7 +6,7 @@
* Copyright (c) 2008-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.12 2010/01/06 18:07:19 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.13 2010/02/16 22:19:59 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@@ -240,6 +240,7 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
es.format = auto_explain_log_format;
ExplainBeginOutput(&es);
+ ExplainQueryText(&es, queryDesc);
ExplainPrintPlan(&es, queryDesc);
ExplainEndOutput(&es);
@@ -255,7 +256,8 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
*/
ereport(LOG,
(errmsg("duration: %.3f ms plan:\n%s",
- msec, es.str->data)));
+ msec, es.str->data),
+ errhidestmt(true)));
pfree(es.str->data);
}