Re: Fwd: Functions not visible in pg_stat_user_functions view - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Fwd: Functions not visible in pg_stat_user_functions view
Date
Msg-id A737B7A37273E048B164557ADEF4A58B057AD4AC@ntex2010a.host.magwien.gv.at
Whole thread Raw
In response to Re: Fwd: Functions not visible in pg_stat_user_functions view  (Bartosz Dmytrak <bdmytrak@gmail.com>)
Responses Re: Fwd: Functions not visible in pg_stat_user_functions view  (Bartosz Dmytrak <bdmytrak@gmail.com>)
List pgsql-general
Bartosz Dmytrak wrote:
> and this is strange for me.
> I have few DBs with the same function (copy -> paste), in one DB they are tracked (visible in
> pg_stat_user_functions) in other not. In DB where some functions are not tracked, others are visible -
> no issue. I cannot find any logical connection between function structure and visibility in
> pg_stat_user_functions.

If you look at the definition of pg_stat_user_functions,
you'll notice that it shows only functions for which
pg_stat_get_function_calls(oid) IS NOT NULL.

The most likely explanation for what you observe is that
the functions have never been called since track_functions
has been set to "all".

You can see if that is indeed the reason by calling one
of your "invisible" functions and see if it becomes
visible afterwards.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Tim Uckun
Date:
Subject: Re: Dropping default privileges.
Next
From: Bartosz Dmytrak
Date:
Subject: Re: Fwd: Functions not visible in pg_stat_user_functions view