Postgresql – To get rid of heavy archive logs in PostgreSQL 9.1

postgresql-9.1

In our production server which is having PostgreSQL 9.1 installed, too heavy archive logs are being generated, approximately 41 GB/day. Heavy updates, deletes and inserts are the cause of this. Can anyone help us to reduce the amount of archive log generation in our production server?

Best Answer

If you don't need to analyze again that log. You can reduce the things that database will be log. Some of them are:

  1. log_statement: Controls which SQL statements are logged. You don't need to log all statement. It can be switched to none.
  2. client_min_messages: can be set to ERROR
  3. log_min_messages: can be set to ERROR
  4. log_min_duration_statement: can be set to a -1 - this means disable it.

All of them are store in file configuration postgresql.conf

You can read more document here.

Hopefully this answer will help you.