Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c1a63c9

Browse files
committed
Suppress coredump when EXPLAINing query that is rewritten to include
a NOTIFY.
1 parent 1dc3051 commit c1a63c9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/backend/commands/explain.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994-5, Regents of the University of California
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.63 2001/01/24 19:42:52 momjian Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.64 2001/01/27 01:41:19 tgl Exp $
99
*
1010
*/
1111

@@ -54,7 +54,7 @@ ExplainQuery(Query *query, bool verbose, CommandDest dest)
5454
return;
5555
}
5656

57-
/* rewriter and planner will not cope with utility statements */
57+
/* rewriter will not cope with utility statements */
5858
if (query->commandType == CMD_UTILITY)
5959
{
6060
elog(NOTICE, "Utility statements have no plan structure");
@@ -88,6 +88,16 @@ ExplainOneQuery(Query *query, bool verbose, CommandDest dest)
8888
Plan *plan;
8989
ExplainState *es;
9090

91+
/* planner will not cope with utility statements */
92+
if (query->commandType == CMD_UTILITY)
93+
{
94+
if (query->utilityStmt && IsA(query->utilityStmt, NotifyStmt))
95+
elog(NOTICE, "QUERY PLAN:\n\nNOTIFY\n");
96+
else
97+
elog(NOTICE, "QUERY PLAN:\n\nUTILITY\n");
98+
return;
99+
}
100+
91101
/* plan the query */
92102
plan = planner(query);
93103

0 commit comments

Comments
 (0)