I know I can reset some counters by running:

select pg_stat_reset()

but some counters like xact_commit aren't reset.

How can I do it?

I've tried also:


but doesn't work. :-(

Any ideas, please?

I could store the last counters and substract for the next time.


The solution is simple, store previous values and substract. No need to reset anything in Postgres. In this way meaningful stats can be obtained:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.