Supabase Cron & pg_cron (PostgreSQL)

Test a pg_cron schedule.

Supabase Cron runs on the pg_cron extension. Paste the schedule you give cron.schedule(): the tester uses a line-by-line port of pg_cron 1.6.8’s parser, checked against the C code itself, so it accepts and rejects exactly what pg_cron does.

GMT (pg_cron default)
How pg_cron / Supabase Cron differs from Linux cron. Day of week: 0-7; 0 and 7 are Sunday. Time zone: GMT; cron.timezone server setting. Compare pg_cron / Supabase Cron with Linux cron, side by side →
The rules

How Supabase / pg_cron reads a schedule.

Fields5 (minute hour day-of-month month day-of-week), Vixie cron syntax. Names for months and weekdays (jan, mon). 0 and 7 are Sunday.
Last day of month$ in the day-of-month field, on its own: 0 12 $ * *.
Sub-minute[1-59] seconds, e.g. '30 seconds'; it cannot be combined with other fields. On Supabase it needs Postgres 15.1.1.61 or later.
Day of month + day of weekOR, as in Unix cron, unless one of them is *. The server setting cron.match_dom_and_dow switches to AND.
Time zoneGMT, unless the server sets cron.timezone in postgresql.conf (a restart-time setting).
Not accepted1/5 (a step needs * or a range), steps larger than the field (*/60), L, W, #, ?.

The parser is a port of pg_cron 1.6.8’s entry.c. It was compared with that C code, compiled, on 4,000 schedules, bit for bit (0 differences). Matching follows pg_cron.c. Last checked 18 November 2026.

Four pg_cron quirks the parser test turned up

  • @yearly and @annually never run. cron.schedule() accepts them, but pg_cron’s parser sets the month with the wrong lower bound, so no month is selected and the job never fires. Use 0 0 1 1 *.
  • A reversed range is not a wrap-around. pg_cron sets reversed ranges a byte (8 values) at a time: 0 22-2 * * * happens to give 22:00-02:00, but 0 10-2 * * * gives 00:00-02:00 and 10:00-15:00 only, and 0 0 * * 5-1 gives no weekday at all, so the job never runs. Write both parts: 0 22,23,0,1,2 * * * or 0 10-23,0-2 * * *.
  • Text after the fifth field is ignored. 0 3 * * * VACUUM is accepted as 0 3 * * *; the command belongs in the third argument of cron.schedule().
  • @reboot and @restart run once when the pg_cron background worker starts.

Supabase specifics

Supabase Cron is a dashboard and API on top of pg_cron; jobs are stored in cron.job, and each run is logged in cron.job_run_details (pg_cron’s cron.log_run setting, on by default). Supabase recommends no more than 8 jobs running at the same time and no job longer than 10 minutes. Supabase’s own examples give times in GMT, which is pg_cron’s default time zone.

Clean up the run history

Frequent jobs fill cron.job_run_details quickly. pg_cron’s README suggests deleting old rows with pg_cron itself, for example a daily job that removes entries older than 7 days.

Sources: pg_cron README · pg_cron src/entry.c (v1.6.8) · Supabase Cron · Supabase Cron quickstart

Related: Daylight saving time checker · Crontab file checker · All platform tools

Common questions

Supabase / pg_cron FAQs.

pg_cron runs in GMT by default. The cron.timezone setting can change it, but it is a server setting in postgresql.conf that takes effect on restart; Supabase’s examples use GMT.

Use the interval form as the schedule: select cron.schedule('job-name', '30 seconds', $$ ... $$); Any value from 1 to 59 seconds works, and it cannot be combined with other cron fields. On Supabase it needs Postgres 15.1.1.61 or later.

Put $ in the day-of-month field, for example 0 12 $ * * for 12:00 GMT on the last day of every month.

pg_cron accepts @yearly and @annually but its parser leaves the month field empty for them, so they never match. Use 0 0 1 1 * instead.

OR by default, like Unix cron: 0 0 1 * 1 runs on the 1st and on every Monday. If either field is *, only the other one counts. Setting cron.match_dom_and_dow = on makes it AND.