Re: HOWTO : plpgsql stored function spawn cron job that will run other stored functions

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Robert M(dot) Bernabe <rbernabe(at)sandmansystems(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: HOWTO : plpgsql stored function spawn cron job that will run other stored functions
Date: 2007-12-21 14:48:43
Message-ID: BE57A1F4-41FE-4683-B419-8229A4D621FB@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Robert M. Bernabe 2007-12-21 23:42:11 Re: HOWTO : plpgsql stored function spawn cron job that will run other stored functions
Previous Message Robert M. Bernabe 2007-12-21 12:43:10 Re: HOWTO : plpgsql stored function spawn cron job that will run other stored functions