Skip to content

Commit 202cbdc

Browse files
committed
Fix log_executor_stats for non-multi queries. Backpatch to 7.4.X.
1 parent 2146bfc commit 202cbdc

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/backend/tcop/pquery.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.74 2003/11/29 19:51:57 pgsql Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.75 2004/03/05 00:21:41 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -406,6 +406,17 @@ PortalRun(Portal portal, long count,
406406
if (completionTag)
407407
completionTag[0] = '\0';
408408

409+
if (portal->strategy != PORTAL_MULTI_QUERY)
410+
{
411+
ereport(DEBUG3,
412+
(errmsg_internal("PortalRun")));
413+
/* PORTAL_MULTI_QUERY logs its own stats per query */
414+
if (log_executor_stats)
415+
ResetUsage();
416+
}
417+
418+
if (log_executor_stats && portal->strategy != PORTAL_MULTI_QUERY)
419+
409420
/*
410421
* Check for improper portal use, and mark portal active.
411422
*/
@@ -500,6 +511,9 @@ PortalRun(Portal portal, long count,
500511
PortalContext = savePortalContext;
501512
QueryContext = saveQueryContext;
502513

514+
if (log_executor_stats && portal->strategy != PORTAL_MULTI_QUERY)
515+
ShowUsage("EXECUTOR STATISTICS");
516+
503517
return result;
504518
}
505519

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy