finds.dev← search

// the find

GaoWeiChang/auto-job

C · updated Apr 2026

A PostgreSQL extension for background job scheduling

A PostgreSQL extension that runs stored procedures on a schedule using background workers — no cron, no external scheduler. The launcher pattern it uses to support multiple databases is the interesting architectural piece here, solving a real BGW limitation elegantly.

The launcher-per-database design is genuinely well thought out: one stable BGW in the `postgres` database manages workers across all user databases, which is exactly the right answer to the BGW initialization constraint. Crash recovery is handled at both levels — the postmaster restarts the launcher, and the launcher re-spawns job workers after database recovery. The job catalog table exposes status, last run time, and error messages in a queryable way, which is more useful than log-scraping. Manual `run_job()` override is a small but practical addition.

Zero stars, zero forks, and a single contributor — this is an experiment, not a production dependency you'd want to take on. The `dblink` dependency for cross-database registry writes is a known footgun: it uses a separate connection, bypasses the current transaction, and can leave stale registry entries if the `CREATE EXTENSION` call fails partway through. PG17-only is a hard constraint with no explanation of what would break on 16. No test suite beyond a handful of SQL statements in `test/test_job.sql`, and no documentation on concurrency behavior if a job's interval is shorter than its own execution time.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →