Re: Can i write a time-trigger? - Mailing list pgsql-admin

From Shruthi A
Subject Re: Can i write a time-trigger?
Date
Msg-id 6caee9520911182201h2482d449lfb39f7d882deb73b@mail.gmail.com
Whole thread Raw
In response to Re: Can i write a time-trigger?  (Jure Kobal <j.kobal@gmx.com>)
Responses Re: Can i write a time-trigger?  (Guillaume Lelarge <guillaume@lelarge.info>)
List 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.kobal@gmx.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

pgsql-admin by date:

Previous
From: Jure Kobal
Date:
Subject: Re: Can i write a time-trigger?
Next
From: Michael Graziano
Date:
Subject: Re: Practice of backups