Re: [SQL] Job control in sql

2012-06-04 Thread lewbloch
Sorry about the earlier unfinished post - premature click. Svenne Krap wrote: > Ireneusz Pluta wrote: >> Svenne Krap pisze: > >> I am building a system, where we have jobs that run at different > >> times (and takes widely different lengths of time). > >> > >> Basically I have a jobs table: > >> >

Re: [SQL] Job control in sql

2012-06-04 Thread lewbloch
Svenne Krap wrote: > On 29-05-2012 12:32, Ireneusz Pluta wrote: > > W dniu 2012-05-25 10:28, Svenne Krap pisze: > >> Hi. > >> > >> I am building a system, where we have jobs that run at different > >> times (and takes widely different lengths of time). > >> > >> Basically I have a jobs table: > >>

Re: [SQL] Job control in sql

2012-05-29 Thread Svenne Krap
On 29-05-2012 12:32, Ireneusz Pluta wrote: > W dniu 2012-05-25 10:28, Svenne Krap pisze: >> Hi. >> >> I am building a system, where we have jobs that run at different >> times (and takes widely different lengths of time). >> >> Basically I have a jobs table: >> >> create table jobs( >> id seri

Re: [SQL] Job control in sql

2012-05-29 Thread Ireneusz Pluta
W dniu 2012-05-25 10:28, Svenne Krap pisze: Hi. I am building a system, where we have jobs that run at different times (and takes widely different lengths of time). Basically I have a jobs table: create table jobs( id serial, ready boolean, job_begun timestamptz, job_done ti

Re: [SQL] Job control in sql

2012-05-29 Thread Ireneusz Pluta
W dniu 2012-05-25 14:52, Jan Lentfer pisze: Add a sort of status table where you insert your unique job identifer at the start of the function and remove it in the end? As seperate transactions of course. That might leave status set on forever in a case when a job crashes and does not reach th

Re: [SQL] Job control in sql

2012-05-25 Thread Jan Lentfer
On Fri, 25 May 2012 10:28:03 +0200, Svenne Krap wrote: [...] The problem is that a later run of run_jobs() will not see the job_begun has been set by a prior run (that is unfinished - as all queries from the plpgsql-function runs in a single, huge transaction). My intitial idea was to set t

[SQL] Job control in sql

2012-05-25 Thread Svenne Krap
Hi. I am building a system, where we have jobs that run at different times (and takes widely different lengths of time). Basically I have a jobs table: create table jobs( id serial, ready boolean, job_begun timestamptz, job_done timestamptz, primary key (id) ); This should