Skip to content

Instantly share code, notes, and snippets.

@sebastianwebber
Created November 4, 2016 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sebastianwebber/763e5fc88549d1d2a3708a1e2b0eb216 to your computer and use it in GitHub Desktop.
Save sebastianwebber/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