Thread: pg_autovacuum exceptions question

pg_autovacuum exceptions question

From
Chris Bowlby
Date:
Hi Guys,

In relation to pg_autovacuum, I have a quick question, that I can't seem
to find an answer to anywhere. I use a temporary database that only
exists when certain scripts are running, and is dropped when the scripts
are complete. In that process, I have seen pg_autovacuum periodically
examine that database, it really is not necessary for it to do so.

I was wondering if there was a way to prevent pg_autovacuum from doing
that via an exception list? Such that I can insert the name of this
database into a system catalog, or even a string entry in the
postgresql.conf file and not have that database examined?



Re: pg_autovacuum exceptions question

From
Alvaro Herrera
Date:
Chris Bowlby wrote:
> Hi Guys,
>
> In relation to pg_autovacuum, I have a quick question, that I can't seem
> to find an answer to anywhere. I use a temporary database that only
> exists when certain scripts are running, and is dropped when the scripts
> are complete. In that process, I have seen pg_autovacuum periodically
> examine that database, it really is not necessary for it to do so.
>
> I was wondering if there was a way to prevent pg_autovacuum from doing
> that via an exception list? Such that I can insert the name of this
> database into a system catalog, or even a string entry in the
> postgresql.conf file and not have that database examined?

I don't think you can disable autovacuum for individual databases, but
in any case the check should be fairly quick and it should bail out
without doing much.

If we wanted to support this feature, the way to do it would be to add
an option in pg_database or something like that, not the config file.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: pg_autovacuum exceptions question

From
Chris Bowlby
Date:
Hi Alvaro,

 Thanks for the response. I've run into situations where the database
has also been removed just before pg_autovacuum was about to check, and
there by kicks out an error (mainly an aesthetic issue, not really a
functional issue). If an option was added to PostgreSQL itself to
support that, would it be via a:

CREATE DATABASE blip WITH AUTOVACUUM = OFF;

command or something similar?

Alvaro Herrera wrote:
> Chris Bowlby wrote:
>
>> Hi Guys,
>>
>> In relation to pg_autovacuum, I have a quick question, that I can't seem
>> to find an answer to anywhere. I use a temporary database that only
>> exists when certain scripts are running, and is dropped when the scripts
>> are complete. In that process, I have seen pg_autovacuum periodically
>> examine that database, it really is not necessary for it to do so.
>>
>> I was wondering if there was a way to prevent pg_autovacuum from doing
>> that via an exception list? Such that I can insert the name of this
>> database into a system catalog, or even a string entry in the
>> postgresql.conf file and not have that database examined?
>>
>
> I don't think you can disable autovacuum for individual databases, but
> in any case the check should be fairly quick and it should bail out
> without doing much.
>
> If we wanted to support this feature, the way to do it would be to add
> an option in pg_database or something like that, not the config file.
>
>


Re: pg_autovacuum exceptions question

From
Tom Lane
Date:
Chris Bowlby <excalibur@accesswave.ca> writes:
>  Thanks for the response. I've run into situations where the database
> has also been removed just before pg_autovacuum was about to check, and
> there by kicks out an error (mainly an aesthetic issue, not really a
> functional issue).

That was fixed some time ago.  It's not an argument for adding a
"feature" like this.

            regards, tom lane