Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/NikolayS/PgQue/llms.txt

Use this file to discover all available pages before exploring further.

PgQue is not a new queue engine — it is a repackaging of PgQ, one of the longest-running Postgres queue architectures in production. Understanding where PgQ came from explains why PgQue chose to inherit rather than reinvent.

Timeline

YearEvent
2006PgQ started at Skype, inspired by Slony. Designed to handle messaging for hundreds of millions of users.
2007Open-sourced as part of Skytools. First application: Londiste replication.
2009Skytools 3: cascading queues, cooperative consumers. PgCon talk by Marko Kreen & Martin Pihlak (slides).
2026PgQue: single-file PG14+ repackage for managed databases, with a modern API layer.

Lineage

PgQ (Skype, ISC) → Skytools 2/3 → github.com/pgq/pgq → PgQue (Apache-2.0, PG14+)
Skype ran hundreds of queues on PgQ in production. PgQue inherits that engine rather than reinventing it.

What PgQue adds

The original PgQ depends on a C extension (pgq) and an external daemon (pgqd), neither of which run on most managed Postgres providers. PgQue removes both constraints:
  • Pure PL/pgSQL — no C extension, no shared_preload_libraries, no provider approval
  • Single-file install\i sql/pgque.sql in a transaction
  • Modern Postgres support — PostgreSQL 14–18, using pg_snapshot and xid8
  • pg_cron or pg_timetable — replaces the external pgqd daemon for ticking
  • Modern API layersend, receive, ack, nack, DLQ on top of the raw PgQ primitives

The documented failure modes PgQue avoids

PgQue’s architecture choice was validated by real production incidents with SKIP LOCKED queues:
  • Brandur/Heroku (2015) — 60k backlog in one hour under MVCC pressure
  • PlanetScale (2026) — death spiral at 800 jobs/sec with OLAP on the same instance
  • River issue #59 — autovacuum starvation under sustained load
Oban Pro responded by adding table partitioning; PGMQ ships aggressive autovacuum settings. PgQue’s TRUNCATE rotation creates zero dead tuples by construction — no tuning required, immune to xmin horizon pinning.

Attribution

PgQ: ISC license, © Marko Kreen / Skype Technologies OU.
PgQue: Apache-2.0, © 2026 Nikolay Samokhvalov. See NOTICE.

Build docs developers (and LLMs) love