Roberts, Jon wrote: > I've looked at this code all day long and tried many hacks to make it work > with GP but there isn't a way. > > The easiest way I can think of to handle this with the least amount of > change to the architecture is to add another column to pg_job. Maybe a > Boolean called jobcompleted. Then create a view called vw_pg_job which > executes the function pga_next_schedule that returns the jobnextrun value.
I'm not sure why you'd need the extra column, but there are some issues with using a view to replace the nextrun column: - pgAgent queries each job every minute to see if it needs to run. That could lead to a lot of cpu being used on that rather nasty pl/pgsql function. - When we spec'ed pgAgent, it was decided that if a schedule were missed, that instance should run immediately on startup. The proposed change would prevent that behaviour, though personally I'm not sure that's necessarily a bad thing. - The 'Run Now' feature in pgAdmin would need to be reworked - perhaps by adding a flag to pg_job to indicate the job should run once regardless of scheduling. The second are more minor issues, but the first doesn't seem at all good to me. Regards, Dave. ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster