Skip to main content

15. Scheduling and Automation

PostgreSQL does not ship with a built-in event scheduler like some databases. In practice you automate recurring tasks with extensions or external schedulers.

Decision Guide

NeedPreferNotes
Simple recurring SQL jobspg_cronRequires extension and server config
Complex workflowsexternal schedulerBetter observability and retries
Maintenance tasksscheduled VACUUM/ANALYZE, refresh matviewsKeep jobs idempotent

Lessons

What's Next