Skip to content

Instantly share code, notes, and snippets.

@sebawebber
Created November 4, 2016 21:26
Show Gist options
  • Select an option

  • Save sebawebber/763e5fc88549d1d2a3708a1e2b0eb216 to your computer and use it in GitHub Desktop.

Select an option

Save sebawebber/763e5fc88549d1d2a3708a1e2b0eb216 to your computer and use it in GitHub Desktop.
List PGAgent next jobs
SELECT
pga_job.jobname as job_name,
pga_jobstep.jstdbname as database_name,
pgagent.pga_next_schedule(
pga_schedule.jscid,
pga_schedule.jscstart,
pga_schedule.jscend,
pga_schedule.jscminutes,
pga_schedule.jschours,
pga_schedule.jscweekdays,
pga_schedule.jscmonthdays,
pga_schedule.jscmonths) as next_run
FROM
pgagent.pga_job
JOIN
pgagent.pga_schedule ON pga_schedule.jscjobid = pga_job.jobid
JOIN
pgagent.pga_jobstep ON pga_jobstep.jstjobid = pga_job.jobid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment