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
| Need | Prefer | Notes |
|---|---|---|
| Simple recurring SQL jobs | pg_cron | Requires extension and server config |
| Complex workflows | external scheduler | Better observability and retries |
| Maintenance tasks | scheduled VACUUM/ANALYZE, refresh matviews | Keep jobs idempotent |
Lessons
What's Next
- Continue to 16. Transactions and Concurrency