Evolution of PostgreSQL Job Schedulers — pgAgent, pg_cron, and pg_timetable
Presented by:

Rajesh Kandasamy
No video of the event yet, sorry!
The landscape of job scheduling within PostgreSQL has undergone a significant transformation, moving from external, administratively intensive tools to sophisticated, in-database automation engines. This evolution, marked by the progression from pgagent to pg_cron and pg_timetable, reflects a broader trend towards operational simplicity, enhanced flexibility, and tighter integration with the database core. pgAgent, one of the earliest PostgreSQL-native job schedulers, was designed as part of the pgAdmin project to provide a GUI-friendly mechanism for executing SQL and shell commands on a schedule. While functional, it relies on an external daemon process and is relatively limited in flexibility and scalability. In contrast, pg_cron, developed by Citus Data, brought lightweight and seamless integration by leveraging PostgreSQL's background worker infrastructure. It allows users to schedule SQL commands using familiar cron syntax, with jobs stored and managed directly in the database. Its simplicity, low overhead, and native feel have made it a popular choice for routine maintenance tasks and time-based automation. Further advancing PostgreSQL job scheduling capabilities, pg_timetable emerged as a modern, feature-rich alternative. Written in Go, it supports complex workflows, conditional execution, chaining of tasks, and external script invocation. It is highly configurable and suitable for more sophisticated job orchestration needs, including error handling, dependency management, and parallel execution. This presentation explores the technical evolution, use cases, and trade-offs among pgAgent, pg_cron, and pg_timetable, highlighting how PostgreSQL’s job scheduling capabilities have matured to support a wide range of operational requirements — from simple task automation to enterprise-grade workflow orchestration.
- Date:
- 2025 October 17 11:40 +11
- Duration:
- 40 min
- Room:
- Oxford I + II
- Conference:
- PG Down Under 2025
- Language:
- Track:
- Ops and Administration
- Difficulty:
- Medium