Re: [SQL] organizing cron jobs in one function

2012-11-19 Thread Jasen Betts
On 2012-11-17, Louis-David Mitterrand wrote: > Hi, > > I'm planning to centralize all db maintenance jobs from a single > pl/pgsql function called by cron every 15 minutes (highest frequency > required by a list of jobs). In pseudo code: centralising execution of cron jobs into a single function

Re: [SQL] organizing cron jobs in one function

2012-11-19 Thread Louis-David Mitterrand
On Mon, Nov 19, 2012 at 08:31:10AM +0800, Craig Ringer wrote: > On 11/19/2012 01:11 AM, Louis-David Mitterrand wrote: > > On Sun, Nov 18, 2012 at 07:27:54PM +0800, Craig Ringer wrote: > >> On 11/18/2012 12:19 AM, Louis-David Mitterrand wrote: > >>> Hi, > >>> > >>> I'm planning to centralize all db

Re: [SQL] organizing cron jobs in one function

2012-11-18 Thread Craig Ringer
On 11/19/2012 01:11 AM, Louis-David Mitterrand wrote: > On Sun, Nov 18, 2012 at 07:27:54PM +0800, Craig Ringer wrote: >> On 11/18/2012 12:19 AM, Louis-David Mitterrand wrote: >>> Hi, >>> >>> I'm planning to centralize all db maintenance jobs from a single >>> pl/pgsql function called by cron every

Re: [SQL] organizing cron jobs in one function

2012-11-18 Thread Louis-David Mitterrand
On Sun, Nov 18, 2012 at 07:27:54PM +0800, Craig Ringer wrote: > On 11/18/2012 12:19 AM, Louis-David Mitterrand wrote: > > Hi, > > > > I'm planning to centralize all db maintenance jobs from a single > > pl/pgsql function called by cron every 15 minutes (highest frequency > > required by a list of j

Re: [SQL] organizing cron jobs in one function

2012-11-18 Thread Craig Ringer
On 11/18/2012 12:19 AM, Louis-David Mitterrand wrote: > Hi, > > I'm planning to centralize all db maintenance jobs from a single > pl/pgsql function called by cron every 15 minutes (highest frequency > required by a list of jobs). It sounds like you're effectively duplicating PgAgent. Why not use

[SQL] organizing cron jobs in one function

2012-11-17 Thread Louis-David Mitterrand
Hi, I'm planning to centralize all db maintenance jobs from a single pl/pgsql function called by cron every 15 minutes (highest frequency required by a list of jobs). In pseudo code: CREATE or replace FUNCTION cron_jobs() RETURNS void LANGUAGE plpgsql AS $$ DECLARE rec record; BEGIN /*