How it works
pg_cron uses the same schedule syntax as Unix cron, so '0 1 * * *' runs a job at 1 a.m. every day. Jobs are plain SQL or calls to database functions, and their history is kept in a table. Supabase, AWS RDS, Google Cloud SQL and Azure support it.
It suits work that only touches the database (archiving, rollups, expiring rows). Jobs that call outside services are usually better in a queue or a scheduled function. Schedules run in UTC unless configured otherwise, which matters for daily jobs in other time zones.
pg_cron pricing
Related terms
More in Databases and storage
Keeping data correct