Re: Database stats ( pg_stat_database.stats_reset ) get reset on daily basis - why?

From: Steeve Boulanger <sboulanger29(at)gmail(dot)com>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: "Ray O'Donnell" <ray(at)rodonnell(dot)ie>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Database stats ( pg_stat_database.stats_reset ) get reset on daily basis - why?
Date: 2024-11-26 02:48:38
Message-ID: CAAiSvx8-2MNZ=t1o_PU9R-Z84kL8c-nNGq4FMmdy9jc7z-M7FA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> As a superuser, rename pg_stat_reset inside one of the commonly affected
databases:
> alter function pg_stat_reset rename to
hey_stop_running_pg_stat_reset_already;
> Then see who starts complaining. Additionally, your server log will get
helpful entries like this:

Thanks for the tip Greg - that's very clever! I've done this just now,
and will check back tomorrow to see if there's any corresponding error
message.

NB: I hadn't originally realized that the system functions (ie pg_*) were
created for each database, so I had renamed only the one in the postgres
database, thinking it was global (ie I'll blame this on my Oracle days
;-)).

Now I renamed the function under one database that had been verified as
getting its stats reset on a daily basis. Hopefully tomorrow we'll get more
interesting info!

-Steeve

On Sat, Nov 23, 2024 at 11:50 AM Greg Sabino Mullane <htamfids(at)gmail(dot)com>
wrote:

> As a superuser, rename pg_stat_reset inside one of the commonly affected
> databases:
>
> alter function pg_stat_reset rename to
> hey_stop_running_pg_stat_reset_already;
>
> Then see who starts complaining. Additionally, your server log will get
> helpful entries like this:
>
> ERROR: function pg_stat_reset() does not exist
>
> Cheers,
> Greg
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message shashidhar Reddy 2024-11-26 03:07:08 Re: Unique key constraint Issue
Previous Message Alan Hodgson 2024-11-26 01:42:52 Re: License question