Databases and storage · Tool

pg_cron

A PostgreSQL extension that runs SQL on a schedule, such as a nightly clean-up, inside the database itself.

Keeping data correct · Open source · updated

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

Open source

Free (PostgreSQL licence).

Approximate, checked September 2026.What the other tools cost

More in Databases and storage

Keeping data correct

All 25 Databases and storage terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.