Re: pgadmin's pgagent job scheduler - Mailing list pgsql-general

From Dave Page
Subject Re: pgadmin's pgagent job scheduler
Date
Msg-id 47148E05.5060700@postgresql.org
Whole thread Raw
In response to Re: pgadmin's pgagent job scheduler  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
Responses Re: pgadmin's pgagent job scheduler
List pgsql-general
Ow Mun Heng wrote:
> I see.. and in the docs, I was told to import pgagent.sql into the
> postgres DB so I did that. but actually. I want to deploy it to the
> target DB, let's call it "MyDB". Should I have imported it to MyDB
> instead?

No, postgres is normal. You can specify with each job step which
database it should run on. That way you can have a single job touching
multiple databases.

>>> Additionally, when I connect as NON-postgres user, I can't get to the
>>> pgagent schema. How do I grant access to it? pgagent schema doesnt' seem
>>> to show up as a table.
>> Hmm, that something that no-ones asked about before.
>
> never ask.. never know..

:-)

> Okay.. so, now it pgagent connects to the DB as user postgres (as I was
> instructed by the docs) and runs as user postgres (which is a risk). How
> do I connect as a less priv user? (I have a user, named "operator" which
> does menial tasks like connect to the DB, pull data, crunch etc..)
>
> I most certainly don't want it to run as user postgres. User operator
> would be better.

Just change the pgAgent connection string to use the operator role, and
run the daemon under a similarly non-privileged user account. You'll
also need to make sure you've granted appropriate permissions on the
schema to allow the operator role to update rows etc (which happens when
a job is run to set the next runtime).

Regards, Dave

pgsql-general by date:

Previous
From: Ow Mun Heng
Date:
Subject: Re: pgadmin's pgagent job scheduler
Next
From: Marek Lewczuk
Date:
Subject: 8.3 beta problems