From 634b4b79cbc7638feb459a1b76eae7af47af4606 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 5 Oct 2018 14:14:03 +0200 Subject: [PATCH] Track procedure calls in pg_stat_user_functions This was forgotten when procedures were implemented. Reported-by: Lukas Fittl --- src/backend/commands/functioncmds.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 6f629a00e8..3fd73a69f0 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -60,6 +60,7 @@ #include "parser/parse_expr.h" #include "parser/parse_func.h" #include "parser/parse_type.h" +#include "pgstat.h" #include "utils/acl.h" #include "utils/builtins.h" #include "utils/fmgroids.h" @@ -2219,6 +2220,7 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver EState *estate; ExprContext *econtext; HeapTuple tp; + PgStat_FunctionCallUsage fcusage; Datum retval; fexpr = stmt->funcexpr; @@ -2302,7 +2304,9 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver i++; } + pgstat_init_function_usage(&fcinfo, &fcusage); retval = FunctionCallInvoke(&fcinfo); + pgstat_end_function_usage(&fcusage, true); if (fexpr->funcresulttype == VOIDOID) {