PostgreSQL queues done right with PgQ | POSETTE: An Event for Postgres 2026
Learn how PostgreSQL queues can be implemented using PgQ. Alexander Kukushkin (Microsoft) demonstrates this in his talk “PostgreSQL queues done right with PgQ” at POSETTE: An Event for Postgres 2026. Abstract: Modern applications often rely on message queues - for background jobs, data pipelines, notifications, and event-driven architectures. Using something external like Kafka, Redis, RabbitMQ, etc increases operational complexity and introduces new failure modes. It all could be avoided by keeping a message queue in a database. Quick research on the internet shows that developers commonly are trying to engineer the database queue based on SELECT … FOR UPDATE SKIP LOCKED (available since 9.5). This approach works reasonably well under small load, and spectacularly falls apart if subscribers can’t keep up with publishing rate. PostgreSQL can do better, and in fact, it already did. PgQ is PostgreSQL extension that provides generic, high-performance lockless queue with simple SQL. In this talk, we start with why common SELECT … FOR UPDATE SKIP LOCKED approaches fall apart under load, and how PgQ quietly solved those problems a couple decades ago. Then we take a deep look at PgQ internals: snapshot-based event reads, transaction-ordered delivery, and how PgQ gets away with just a single index to achieve high throughput and consistency. Finally, we will discuss practical patterns for running PgQ on managed PostgreSQL services where this extension is typically not available. Alexander Kukushkin is better known in the PostgreSQL community as "the Patroni guy". Patroni is an open source tool for implementing PostgreSQL clustering and high availability. Besides Patroni, Alexander occasionally contributes to PostgreSQL and other open source projects and tools, usually Postgres related. Alexander is a Principal Software Engineer at Microsoft ► Video chapters: ⏩ 00:00 – Music & introduction ⏩ 00:26 – Agenda: queues, problems, PgQ ⏩ 01:15 – Why use in-database queues ⏩ 02:16 – Naive queue table design ⏩ 03:05 – Consuming with skip locked ⏩ 04:03 – Scaling issues & table bloat ⏩ 06:02 – Visibility timeout workaround ⏩ 09:11 – Partitioning and pointer approach ⏩ 11:08 – PgQ architecture & core concepts ⏩ 13:25 – PgQ API: queues, batches, consumers ⏩ 16:49 – Internals: ticks, batches, MVCC ⏩ 20:00 – Running PgQ on managed cloud ⏩ 23:00 – Replacing pgqd with pg_cron ⏩ 26:53 – Final recap: why PgQ wins 📕 Everything you need to know about POSETTE: An Event for Postgres can be found at: https://posetteconf.com ✅ Learn more: watch more POSETTE talks: https://aka.ms/posette-playlist 📌 Let’s connect: LinkedIn: / posetteconf X – @PosetteConf, https://x.com/PosetteConf Mastodon – @posetteconf, https://mastodon.social/@posetteconf Bluesky – @posetteconf.com, https://aka.ms/posette-on-bluesky #PosetteConf #PostgreSQL #database

PostgreSQL LISTEN/NOTIFY Bottleneck: What We Learned in Production

Turing Award Winner: Disagreeing with Google, Postgres, Future Problems | Mike Stonebraker

Who Let The Agent In? Securing MCP Servers In Production

Keynote: After the AI Hype – What’s Real, and What’s Next - Richard Campbell - 2026

Bringing Graph to PostgreSQL: a deep-dive into Apache AGE

NeXT Computer: The Billion-Dollar Mistake That Wasn't

Jfrog | Jfrog Artifactory | Jfrog Artifactory Tutorial | Artifactory Tutorial | Intellipaat

Google & AWS Veteran: What Top Tier Software Architects Do Differently

99% of Developers Don't Get PostgreSQL

Chosen One!! The Assignment Over Your Life is Not for the Weak 💯 You've Done the Impossible!!

Android 17 sucks. So I put Linux on a phone.

No Boss, No Money: The Raw Reality of China’s Gen-Z Freelancers

The 'Do-Not-Hire List' Is Real. Here's What Actually Gets You On It.

Stanislav Krapivnik: Russlands Wut kocht über – Steht ein EU-Russland-Krieg bevor?

How to Be Right and Lose Everything

The French Do Not Care About Work

The Riskiest Moment of the AI Bubble

System Design Explained: APIs, Databases, Caching, CDNs, Load Balancing & Production Infra

MCP vs API: Why traditional APIs are failing AI agents

