PgQue v0.1.0 is out.
PgQ -- the Postgres queue system built at Skype 20 years ago for 1B-user-scale workloads -- repackaged for the managed-Postgres era. One SQL file. No C extension. No external daemon. pg_cron to tick.
Why bother reviving a 2007 architecture?
Every major Postgres queue in production today uses some flavor of SKIP LOCKED UPDATE/DELETE. It works under light load. When you have more data and higher load, it degrades predictably. Then you get posts like these:
- Brandur at Heroku, 2015: 60k job backlog in one hour from a single open transaction
- PlanetScale, 2026: death spiral at 800 jobs/sec
- River issue #59, awa issue #169 and so on, Oban's partitioning work, PGMQ's autovacuum tuning guide and duct-taping with pg_partman
The core issue is how Postgres MVCC is implemented and how we deal with it. Dead tuples in the hot path, xmin horizon pinned, vacuum falling behind, query performance quickly degrades. This happens every time you run pg_dump, execute an analytical query, or have a lagging/unused logical replication slot.
PgQ solved this in 2007 with snapshot-based batching and TRUNCATE rotation -- zero dead tuples in the event
path, by design.
But PgQ needed a C extension and an external daemon. Which means it doesn't run on RDS, Aurora, Cloud SQL, AlloyDB, Supabase, or Neon -- i.e., where most
Postgres lives now.
PgQue closes that gap.
💎 Pure SQL PL/pgSQL (PgQ engine)
👩💻 \i sql/pgque.sql -- you're done
🕑 pg_cron replaces pgqd (optional, recommended)
💻 Python, Go, TypeScript client examples shipped
💙 Apache 2.0
Trade-off: end-to-end event delivery latency is up to a second, it depends on ticking frequency. If you need sub-3ms job dispatch, use River, Oban, or graphile-worker (and avoid anything that blocks xmin horizon). If you need high-throughput event streaming with fan-out inside Postgres -- Kafka-shaped, without Kafka and dealing with transactional outbox implementation -- this is the right shape of tool.
Kudos to Marko Kreen and Skype engineers who implemented this decades ago, for the original PgQ, and to Alexander Kukushkin whose recent "Rediscovering PgQ" talk brought this quiet corner of the Postgres ecosystem back into view.
Stars, issues, PRs, and honest criticism all welcome.
Link 👇