Skip to content

Commit 634b4b7

Browse files
committed
Track procedure calls in pg_stat_user_functions
This was forgotten when procedures were implemented. Reported-by: Lukas Fittl <[email protected]>
1 parent 9c2a970 commit 634b4b7

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)