Re: HOWTO : plpgsql stored function spawn cron job that will run other stored functions - Mailing list pgsql-novice

From John DeSoi
Subject Re: HOWTO : plpgsql stored function spawn cron job that will run other stored functions
Date
Msg-id BE57A1F4-41FE-4683-B419-8229A4D621FB@pgedit.com
Whole thread Raw
In response to Re: HOWTO : plpgsql stored function spawn cron job that will run other stored functions  ("Robert M. Bernabe" <rbernabe@sandmansystems.com>)
List pgsql-novice
On Dec 21, 2007, at 7:43 AM, Robert M. Bernabe wrote:

> Thanks for the reply. PGAgent is one option I've found but I was
> hoping somebody can suggest another way to do this that would just
> use plpgsql and maybe cron. Another method perhaps that is not
> dependent  PGAgent...


You can't do this in plpgsql alone. There is no built-in facility to
make something run at some interval. If you use cron, all you need to
do is have it call your function from a shell script. Something like:

psql -d database -U user -c "select my_store_function()"




John DeSoi, Ph.D.




pgsql-novice by date:

Previous
From: "Robert M. Bernabe"
Date:
Subject: Re: HOWTO : plpgsql stored function spawn cron job that will run other stored functions
Next
From: "Robert M. Bernabe"
Date:
Subject: Re: HOWTO : plpgsql stored function spawn cron job that will run other stored functions