Re: running vacuum in scripts

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: "Belinda M(dot) Giardine" <giardine(at)bio(dot)cse(dot)psu(dot)edu>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: running vacuum in scripts
Date: 2005-09-20 13:28:21
Message-ID: 1127222901.3026.153.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You could use the system wide crontab, which is configured via
/etc/crontab, and there you can specify what user should execute the
command, without needing passwords. The system wide crontab is executed
as root and it will su to the user you specify.

For vacuuming, you could try to use the autovacuum daemon, it is
included in the contrib part of postgres. If you installed from source,
you will likely need to separately install autovacuum, if you installed
a prepackaged postgres, chances are that you already have the
pg_autovacuum executable installed. It is fairly easy to set up.

HTH,
Csaba.

On Mon, 2005-09-19 at 20:27, Belinda M. Giardine wrote:
> This seems like it should be a frequently asked question, but I am having
> trouble finding the answer. I am in the process of switching to using
> Postgres, and realize that I need to run vacuum analyze regularly on the
> tables. This is on a Unix system so cron is the obvious choice. The
> problem is I don't want to put the user name and password in the script.
> As far as I can tell vacuum must be run by the table or database owner.
> It wouldn't be as bad to have the password in the script if it was a
> limited permissions user. Any suggestions on the best methods?
>
> Thanks,
> Belinda
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hartel, Dirk 2005-09-20 13:28:37 Re: Errror in beltane
Previous Message Michael Schuerig 2005-09-20 13:23:17 Re: Implementing a change log