Agent skill · software engineering · aradotso
pgque-postgres-queue
Expert skill for PgQue – a zero-bloat, snapshot-based Postgres queue using pure PL/pgSQL with no C extensions required.
Why this skill is useful
Provides domain-specific knowledge and commands for implementing a snapshot-based Postgres queue that the AI wouldn't reliably generate on its own.
What it needs
Requires pg_cron, postgres installed locally. About 6k tokens when loaded. Last updated 2026-07-09. 70 stars on the source repository.
What this skill does
PgQue – Zero-Bloat Postgres Queue Skill by ara.so — Daily 2026 Skills collection. PgQue is a pure PL/pgSQL reimplementation of the battle-tested PgQ (Skype/Postgres) architecture. It uses snapshot-based batching and TRUNCATE-based table rotation instead of row-level locking, delivering zero dead-tuple bloat, predictable performance under sustained load, and native fan-out — all from a single SQL file on any Postgres 14+ instance including managed providers (RDS, Aurora, Cloud SQL, Supabase, Neon). Key Concepts Tick: A periodic snapshot that closes a batch of events. Nothing is delivered until a tick fires. Batch: A group of events captured in one tick, consumed atomically by a subscriber. Subscriber/Consumer: A named cursor on the event log. Multiple consumers get independent copies of every batch (fan-out). Zero bloat: Events are stored in rotating tables and cleared via TRUNCATE, never DELETE. No dead tuples. Latency trade-off: End-to-end delivery is ~1–2 s (one tick interval + poll). Per-call function latency is microseconds. Installation Requirements Postgres 14+ pgcron (recommended) or an external scheduler calling pgque.ticker() every second Install from SQL file Or inside a psql session: Start the ticker (pgcron) Start the ticker (without pgcron) Run these externally on a schedule: Warning: Without a running ticker, consumers see nothing. Enqueue works, but no batches are created. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aradotso/pgque-postgres-queue