Ram
Ram

Reputation: 369

How to identify the tables which are vacuum is disabled

How do I identify tables which are vacuum disabled at the table level?

Upvotes: 0

Views: 655

Answers (1)

user330315
user330315

Reputation:

That information is stored in the column pg_class.reloptions. That column is an array containing key=value pairs.

To find those where autovacuum has been disabled, you can use:

select relnamespace::regnamespace as schema_name, 
       relname as table_name
from pg_class 
where 'autovacuum_enabled=false' = any(reloptions);

(I can't test it, but that should work with 9.4 as well)

Upvotes: 2

Related Questions