when is pg_stat_archiver.stats_reset modified?

Started by Luca Ferrariabout 5 years ago3 messagesgeneral
Jump to latest
#1Luca Ferrari
fluca1978@gmail.com

Hi all,
running on 12.5, but I guess this does not mind, I cannot understand
when the value of pg_stat_archiver.stats_reset field is modified.
I've executed a pg_stat_reset() but it did not affected the specified field.
I suppose that field is not "resettable" by the administrator, as I
tried to, but then what drives changes?

Thanks,
Luca

#2Ian Lawrence Barwick
barwick@gmail.com
In reply to: Luca Ferrari (#1)
Re: when is pg_stat_archiver.stats_reset modified?

2021年2月18日(木) 20:21 Luca Ferrari <fluca1978@gmail.com>:

Hi all,
running on 12.5, but I guess this does not mind, I cannot understand
when the value of pg_stat_archiver.stats_reset field is modified.
I've executed a pg_stat_reset() but it did not affected the specified
field.
I suppose that field is not "resettable" by the administrator, as I
tried to, but then what drives changes?

As pg_stat_archiver shows cluster-wide stats, you need
pg_stat_reset_shared().

https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-STATS-FUNCTIONS

Regards

Ian Barwick

--
EnterpriseDB: https://www.enterprisedb.com

#3Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Luca Ferrari (#1)
Re: when is pg_stat_archiver.stats_reset modified?

On Thu, 2021-02-18 at 12:20 +0100, Luca Ferrari wrote:

running on 12.5, but I guess this does not mind, I cannot understand
when the value of pg_stat_archiver.stats_reset field is modified.
I've executed a pg_stat_reset() but it did not affected the specified field.
I suppose that field is not "resettable" by the administrator, as I
tried to, but then what drives changes?

SELECT pg_stat_reset_shared('archiver');

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com