Re: Can i write a time-trigger?

From: Shruthi A <shruthi(dot)iisc(at)gmail(dot)com>
To: Jure Kobal <j(dot)kobal(at)gmx(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Can i write a time-trigger?
Date: 2009-11-19 06:01:57
Message-ID: 6caee9520911182201h2482d449lfb39f7d882deb73b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Wow! Thanks a lot! That was a great deal of help! :-)

On Wed, Nov 18, 2009 at 8:41 PM, Jure Kobal <j(dot)kobal(at)gmx(dot)com> wrote:

>
> > -- While running the pgagent daemon, what dbname should i specify? Is it
> > postgres or pgadmin (as the example in
> >
> http://www.enterprisedb.com/docs/en/8.3/tools/pgadmin/1.8.2/pgagent-install
> > .html) ?
>
> postgres. Since that is the database, pgagent is only a schema inside it.
>

The problem is that sites like the above and

http://www.pgadmin.org/docs/1.8/pgagent-install.html
are misleading, giving dbname=pgadmin in their example, while they clearly
mention that we should create the pgagent catalogs in the 'postgres'
database. Really careless of them!

> > -- I managed to create a 'Job' in pgAdmin with the Definition specifying
> a
> > call to my stored proc (without referencing the database).
>
> How did you manage this? When you select SQL as the type of the step it
> won't
> let you create the step without the database name.
>

You are right. I had actually selected the database when creating the step,
but i had assumed that to be a 'target' for the step to run on, rather than
a reference for the sql. And i had forgotten about it. Anyways, my
mistake. Sorry!

> If you wan't to debug it you can run it with "-f" and "-l 2". With that it
> will run in foreground(-f) and debug mode(-l 2). That way you can see what
> it's doing.
>
> This is amazingly helpful. More than i had imagined. Thanks! What i had
initially thought by looking at pgagent --help which claims that with the -l
option, 0 is error, 1 is warning, 2 is debug and 0 is default. So i had
thought that any error should be automatically flagged by the process when i
run it in foreground (-f). Including 'database pgadmin does not exist'.
But it didn't. On further investigation after your suggestion, i found that
this is considered only a 'warning' and not an 'error'! So it is flagged
with -l 1 or 2, but not with 0. Isn't this ridiculous!

So now i know why my job wasn't running!
And the -l 2 option (debug mode) is really great! It gives me so many
details i'm thrilled! :-)

Anyways thanks a lot! Now i'm up and running! :-)
Thanks,
Shruthi

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Graziano 2009-11-19 17:17:24 Re: Practice of backups
Previous Message Jure Kobal 2009-11-18 15:11:17 Re: Can i write a time-trigger?