PostgreSQL: How to enable autovacuum?

JTW picture JTW · Oct 28, 2015 · Viewed 10.7k times · Source

How does one enable autovacuum in PostgreSQL? I understand the purpose, I just can't find a simple answer regarding how to enable it.

Answer

Craig Ringer picture Craig Ringer · Oct 28, 2015

Autovacuum is on by default. For small databases just do nothing and everything will work fine. To confirm, check

SHOW autovacuum;

in psql. It should report on.

Large and busy databases sometimes require tuning to make autovacuum run more often, or focus more on busy queue tables. See the manual for details on tuning autovacuum.