Re: cron tasks in pg 9.3

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Joe Van Dyk <joe(at)tanga(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: cron tasks in pg 9.3
Date: 2013-07-18 22:08:31
Message-ID: 20130718220831.GB4139@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joe Van Dyk wrote:
> Will the custom worker support in 9.3 let me put cron-like tasks into
> postgresql?
>
> I have a lot of database functions that should run every few seconds, every
> minute, every hour, once a week, etc. Right now, I always have to have
> exactly one machine setup with cron tasks that tells postgresql to run
> whatever functions are necessary.

Yes, you should be able to do that, but there's no scheduling code yet.
There has been talk about porting the execution part (i.e. no UI) of
pgagent into a bgworker, but so far I don't know of any code.

If you want your tasks to just run some queries, that's easy to arrange.
If you want to do things like run separate processes (say pg_dump) it
might be a bit more involved.

The new facilities in 9.4 that let you start dynamic bgworkers would
ease things even more.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pedro Costa 2013-07-18 22:11:31 Best Postgresql books
Previous Message Joe Van Dyk 2013-07-18 21:44:46 Re: cron tasks in pg 9.3