Skip to content

Reset all stats, including related to bgwriter and archiver

Nikolay Samokhvalov requested to merge pg_reset_allstats into master

Reset some cluster-wide statistics counters to zero, depending on the argument (requires superuser privileges by default, but EXECUTE for this function can be granted to others). Calling pg_stat_reset_shared('bgwriter') will zero all the counters shown in the pg_stat_bgwriter view. Calling pg_stat_reset_shared('archiver') will zero all the counters shown in the pg_stat_archiver view.

See https://www.postgresql.org/docs/current/static/monitoring-stats.html

Merge request reports