diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-27 01:41:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-27 01:41:19 +0000 |
commit | c1a63c944ddcafdd70c5175eb103b87bef93512c (patch) | |
tree | 737dffdfefc441120abff8819c2e432f3276a59b | |
parent | 1dc30510884f7f654188b1186988929ab812fd04 (diff) | |
download | postgresql-c1a63c944ddcafdd70c5175eb103b87bef93512c.tar.gz postgresql-c1a63c944ddcafdd70c5175eb103b87bef93512c.zip |
Suppress coredump when EXPLAINing query that is rewritten to include
a NOTIFY.
-rw-r--r-- | src/backend/commands/explain.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 5ad981c6421..31f24d88a6f 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.63 2001/01/24 19:42:52 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.64 2001/01/27 01:41:19 tgl Exp $ * */ @@ -54,7 +54,7 @@ ExplainQuery(Query *query, bool verbose, CommandDest dest) return; } - /* rewriter and planner will not cope with utility statements */ + /* rewriter will not cope with utility statements */ if (query->commandType == CMD_UTILITY) { elog(NOTICE, "Utility statements have no plan structure"); @@ -88,6 +88,16 @@ ExplainOneQuery(Query *query, bool verbose, CommandDest dest) Plan *plan; ExplainState *es; + /* planner will not cope with utility statements */ + if (query->commandType == CMD_UTILITY) + { + if (query->utilityStmt && IsA(query->utilityStmt, NotifyStmt)) + elog(NOTICE, "QUERY PLAN:\n\nNOTIFY\n"); + else + elog(NOTICE, "QUERY PLAN:\n\nUTILITY\n"); + return; + } + /* plan the query */ plan = planner(query); |