Re: auto vacuuming - Mailing list pgsql-admin

From Matthew T. O'Connor
Subject Re: auto vacuuming
Date
Msg-id 442DA0CA.1050901@zeut.net
Whole thread Raw
In response to Re: auto vacuuming  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: auto vacuuming  ("Jim C. Nasby" <jnasby@pervasive.com>)
Re: auto vacuuming  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
Alvaro Herrera wrote:
> Jim C. Nasby wrote:
>> On Wed, Mar 29, 2006 at 03:36:36PM +0530, Gourish Singbal wrote:
>>> we are using postgresql 8.1.3 and wanted to enable autovacuuming for only
>>> one of the many databases on the same postgresql cluster.
>>> pg_autovacuum seems to allow to ignore only a particular table and not the
>>> database since column vacrelid is OID from pg_class table  Are there any
>>> suggestions to accomplish this tasks?.
>> Currently there is no way to exclude entire databases from autovacuum.
>
> IIRC in one of the original patches I had added a way to do it.  It was
> rejected however; it was argued that there was another mechanism to
> disable it.  I don't remember what it was though.  The only possibility
> that comes to mind is "ALTER DATABASE SET autovacuum TO off" but I don't
> see why would it work.


I think the closest approximation of disabling autovacuum on a per
database basis is to connect to the database in question and perform:

update pg_autovacuum set enabled = 'false';

This will prevent autovacuum from vacuuming or analyzing any of the
tables in the database, but will still check for XID wraparound.


Matt

pgsql-admin by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: auto vacuuming
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Release plans for improvements to partitioning