PgQue brings the battle-proven PgQ architecture — originally built at Skype to handle messaging for hundreds of millions of users — to any Postgres 14+ deployment, including managed providers. Install with one SQL file, no C extension, no daemon, no restart required.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.
Installation
Install PgQue with a single SQL file on any Postgres 14+ instance, managed or self-hosted.
Quickstart
Send your first message, tick the queue, and receive it back in under five minutes.
SQL API Reference
Complete reference for every
pgque.* function — signatures, return types, and role grants.Client Libraries
First-party Python, Go, and TypeScript clients for building consumers and producers.
Why PgQue
Most Postgres queue implementations useSKIP LOCKED with UPDATE and DELETE. Under sustained load, this creates dead tuples, triggers VACUUM pressure, index bloat, and performance drift. PgQue avoids this entire class of problems.
Zero bloat by design
Snapshot-based batching and TRUNCATE-based table rotation produce zero dead tuples in the hot path — no VACUUM tuning required.
No performance decay
Throughput stays constant under sustained load. The queue does not get slower after months of operation.
Native fan-out
Every consumer has its own independent cursor on a shared event log. No data duplication — closer to Kafka topics than job queues.
Managed Postgres ready
Pure SQL + PL/pgSQL. No C extension, no
shared_preload_libraries, no provider approval. Works on RDS, Aurora, Cloud SQL, AlloyDB, Supabase, and Neon.Get started in four steps
Create a queue and send a message
Create a named queue, subscribe a consumer, then send your first event.
Explore the docs
Ticker and scheduling
Configure pg_cron, pg_timetable, or external schedulers for automatic ticking.
Retry and dead letter queue
Handle failures with configurable retries and automatic DLQ routing.
Fan-out patterns
Send one event to multiple independent consumers without data duplication.
How PgQue works
Understand snapshot-based batching, tick cycles, and table rotation.
Latency trade-offs
Learn how tick rate controls end-to-end delivery latency and WAL overhead.
Benchmarks
Throughput numbers and zero-bloat verification under blocked xmin horizon.
