Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 634b4b7

Browse filesBrowse 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 9c2a970 commit 634b4b7
Copy full SHA for 634b4b7

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

‎src/backend/commands/functioncmds.c

Copy file name to clipboardExpand all lines: src/backend/commands/functioncmds.c
+4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.