pg_autovacuum start-script - Mailing list pgsql-general

From Thomas F.O'Connell
Subject pg_autovacuum start-script
Date
Msg-id E71DF318-F85E-11D8-B059-000D93AE0944@sitening.com
Whole thread Raw
Responses Re: pg_autovacuum start-script
List pgsql-general
I'm about to try to implement a simple pg_autovacuum script that can be
used in conjunction with or integrated entirely with the contrib
start-scripts for postgres. I just want to check that what I'm doing
has the appropriate sanity checks.

The behavior I'm considering is:

if pg_ctl status returns a good value then
   if pg_autovacuum is not running then
     start pg_autovacuum
   else
     error
else
   error

Based on what I (think I) know, this covers the cases where:

1. There is not a valid instance of postgres running.
2. There is already a valid instance of pg_autovacuum running (which
can still run as a daemon even in the event that postgres is stopped,
IIRC).
3. It is safe to start pg_autovacuum because neither of the above cases
holds.

Is this logic sufficiently sane?

In a subsequent iteration, I could even warn, I suppose, if the script
discovered any vacuums (whether initiated by pg_autovacuum or no)
already running.

-tfo


pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: R: R: space taken by a row & compressed data
Next
From: Dino Vliet
Date:
Subject: Re: help with trigger