Skip to content

Commit c2055a4

Browse files
committed
Track procedure calls in pg_stat_user_functions
This was forgotten when procedures were implemented. Reported-by: Lukas Fittl <lukas@fittl.com>
1 parent c8ed820 commit c2055a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/commands/functioncmds.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#include "parser/parse_expr.h"
6161
#include "parser/parse_func.h"
6262
#include "parser/parse_type.h"
63+
#include "pgstat.h"
6364
#include "utils/acl.h"
6465
#include "utils/builtins.h"
6566
#include "utils/fmgroids.h"
@@ -2219,6 +2220,7 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver
22192220
EState *estate;
22202221
ExprContext *econtext;
22212222
HeapTuple tp;
2223+
PgStat_FunctionCallUsage fcusage;
22222224
Datum retval;
22232225

22242226
fexpr = stmt->funcexpr;
@@ -2302,7 +2304,9 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver
23022304
i++;
23032305
}
23042306

2307+
pgstat_init_function_usage(&fcinfo, &fcusage);
23052308
retval = FunctionCallInvoke(&fcinfo);
2309+
pgstat_end_function_usage(&fcusage, true);
23062310

23072311
if (fexpr->funcresulttype == VOIDOID)
23082312
{

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