{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530", "published": "2026-11-03T02:10:20Z", "publisher": "PostgresAI", "article": {"title": "PgQ and PgQue: Workflow Engines you might need in PostgreSQL", "url": "https://www.percona.com/blog/pgq-and-pgque-workflow-engines-you-might-need-in-postgresql", "date_published": "2026-09-28T14:43:56Z", "author": "Jobin Augustine", "publisher": "Percona"}, "grade": "A-", "axes": [{"axis": "Factual", "summary": "B+ \u00b7 1 wrong of 15 checked \u00b7 0 caveats \u00b7 partly assessed"}, {"axis": "Applicable", "summary": "A \u00b7 0 checked \u00b7 partly assessed"}, {"axis": "Consistent", "summary": "A \u00b7 0 checked"}, {"axis": "Transparent", "summary": "A- \u00b7 1 wrong of 4 checked \u00b7 0 caveats \u00b7 partly assessed"}, {"axis": "Safe", "summary": "A- \u00b7 1 wrong of 1 checked \u00b7 0 caveats \u00b7 partly assessed"}], "findings": [{"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F3", "claim": "\u2026client libraries exist for Python, Go, TypeScript, and Ruby\u2026", "title": "PgQue 0.2.0 does not ship a Ruby client", "explanation": "PgQue 0.2.0 ships Python, Go, and TypeScript clients. README.md:517 lists Ruby without a completion marker. The client parity matrix includes only the three implemented languages.", "verdict": "False", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/clients/README.md#L1-L5", "label": "pgque@v0.2.2 \u00b7 clients/README.md:1-5"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/clients/README.md#L76-L78", "label": "pgque@v0.2.2 \u00b7 clients/README.md:76-78"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/README.md#L512-L517", "label": "pgque@v0.2.0 \u00b7 README.md:512-517"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/clients/README.md#L77-L79", "label": "pgque@v0.2.0 \u00b7 clients/README.md:77-79"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F2", "claim": "\u2026\\i devel/sql/experimental/observability.sql\u2026", "title": "The observability installation command names the wrong directory", "explanation": "PgQue 0.2.0 places observability.sql under sql/experimental/. docs/reference.md:611 gives the matching installation path. The article's extra devel/ directory makes psql fail to open the file.", "verdict": "Recipe error", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/docs/reference.md#L611-L611", "label": "pgque@v0.2.0 \u00b7 docs/reference.md:611-611"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/docs/reference.md#L632-L646", "label": "pgque@v0.2.2 \u00b7 docs/reference.md:632-646"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/experimental/observability.sql#L1-L12", "label": "pgque@v0.2.0 \u00b7 sql/experimental/observability.sql:1-12"}]}, {"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F1", "claim": "\u2026using send_idem() and maint_idem()\u2026", "title": "PgQue 0.2.0 has no send_idem() or maint_idem()", "explanation": "We found no send_idem() or maint_idem() definitions in PgQue 0.2.0 or 0.2.2. send() delegates to insert_event() without a producer key. The installed SQL does not implement the advertised producer-key deduplication.", "verdict": "Recipe error", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-api/send.sql#L104-L110", "label": "pgque@v0.2.0 \u00b7 sql/pgque-api/send.sql:104-110"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L2879-L2892", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:2879-2892"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L2900-L2905", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:2900-2905"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F4", "claim": "PgQue 0.2.1 fixed the data loss.", "title": "The overflow update correctly distinguishes PgQue 0.2.0 from 0.2.1", "explanation": "PgQue 0.2.0 stops returning rows at max_return without detecting overflow. Version 0.2.1 raises SQLSTATE 54000 before returning an incomplete batch. Version 0.2.2 retains that SQL behavior. TypeScript, Go, and Python consumers propagate the dedicated overflow error before dispatch or acknowledgement.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-api/receive.sql#L58-L60", "label": "pgque@v0.2.0 \u00b7 sql/pgque-api/receive.sql:58-60"}, {"url": "https://github.com/NikolayS/pgque/blob/32bfbe2119c8fcadf6d49efe886435fdde12500d/sql/pgque-api/receive.sql#L53-L58", "label": "pgque@v0.2.1 \u00b7 sql/pgque-api/receive.sql:53-58"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/clients/typescript/src/consumer.ts#L92-L97", "label": "pgque@v0.2.2 \u00b7 clients/typescript/src/consumer.ts:92-97"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/clients/go/consumer.go#L131-L141", "label": "pgque@v0.2.2 \u00b7 clients/go/consumer.go:131-141"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/clients/python/pgque/consumer.py#L248-L265", "label": "pgque@v0.2.2 \u00b7 clients/python/pgque/consumer.py:248-265"}, {"url": "https://github.com/NikolayS/pgque/blob/32bfbe2119c8fcadf6d49efe886435fdde12500d/sql/pgque-api/receive.sql#L53-L56", "label": "pgque@v0.2.1 \u00b7 sql/pgque-api/receive.sql:53-56"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F5", "claim": "\u2026acknowledgement is per batch, not per message\u2026", "explanation": "ack() calls finish_batch(). A normal subscription advances sub_last_tick to sub_next_tick. receive() finishes an empty batch itself. nack() routes a failed event to retry or DLQ before the batch closes.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-api/cooperative_consumers.sql#L442-L450", "label": "pgque@v0.2.0 \u00b7 sql/pgque-api/cooperative_consumers.sql:442-450"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque-api/receive.sql#L67-L70", "label": "pgque@v0.2.2 \u00b7 sql/pgque-api/receive.sql:67-70"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque-api/receive.sql#L127-L136", "label": "pgque@v0.2.2 \u00b7 sql/pgque-api/receive.sql:127-136"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L859-L865", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:859-865"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L402-L403", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:402-403"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-api/receive.sql#L72-L76", "label": "pgque@v0.2.0 \u00b7 sql/pgque-api/receive.sql:72-76"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F6", "claim": "\u2026The ticker emits pg_notify(\u2018pgque_<queue>\u2019, tick_id) after producing a tick\u2026", "title": "The ticker sends pg_notify after inserting a tick", "explanation": "The ticker inserts a tick and sends its ID on pgque_<queue>. ticker_loop() commits each iteration. Its default cadence is 100 milliseconds. Actual tick creation also checks 500 events, 3 seconds of lag, and the idle period.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L788-L794", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:788-794"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-additions/lifecycle.sql#L55-L70", "label": "pgque@v0.2.0 \u00b7 sql/pgque-additions/lifecycle.sql:55-70"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L110-L112", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:110-112"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L758-L764", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:758-764"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/notify.sgml#L186-L191", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/notify.sgml:186-191"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F7", "claim": "The guaranteed rewind window is one rotation period 2 hours by default\u2026", "title": "Rotation waits for consumers and preserves a two-hour default rewind window", "explanation": "The default rotation period is 2 hours. Rotation checks the oldest subscription's snapshot before truncating a table. The code retains tick history for at least one rotation period. A stalled consumer can prevent reclamation.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L99-L101", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:99-101"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L917-L926", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:917-926"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L940-L946", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:940-946"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque.sql#L962-L967", "label": "pgque@v0.2.0 \u00b7 sql/pgque.sql:962-967"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F8", "claim": "\u2026Run it at the top level in psql with autocommit on (the default).", "title": "The consumer loop places COMMIT outside its exception block", "explanation": "PostgreSQL 18.6 permits transaction control in top-level DO blocks. It forbids transaction termination inside an exception subtransaction. The example closes its exception block before COMMIT. The array aggregation collects complete results before acknowledgement.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/plpgsql.sgml#L3754-L3757", "label": "REL_18_6 \u00b7 doc/src/sgml/plpgsql.sgml:3754-3757"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/plpgsql.sgml#L3771-L3775", "label": "REL_18_6 \u00b7 doc/src/sgml/plpgsql.sgml:3771-3775"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/spi.c#L238-L241", "label": "REL_18_6 \u00b7 src/backend/executor/spi.c:238-241"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L22062-L22062", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:22062-22062"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F9", "claim": "\u2026distinct security roles for producers and consumers via pgque_writer and pgque_reader\u2026", "title": "PgQue separates producer, consumer, and administrative roles", "explanation": "roles.sql creates pgque_writer, pgque_reader, and pgque_admin. The administrative role inherits both application roles. Producer and consumer roles remain separate. Applications that produce and consume need both memberships.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-additions/roles.sql#L7-L15", "label": "pgque@v0.2.0 \u00b7 sql/pgque-additions/roles.sql:7-15"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-additions/roles.sql#L45-L50", "label": "pgque@v0.2.0 \u00b7 sql/pgque-additions/roles.sql:45-50"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F10", "claim": "\u2026Schedule events for future execution, promoted into the queue when due\u2026", "title": "Delayed delivery exists as an optional SQL installation", "explanation": "sql/experimental/delayed.sql defines send_at() and maint_deliver_delayed(). Future events enter delayed_events. Maintenance removes due entries and inserts them into their destination queues. These objects require a separate installation.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/experimental/delayed.sql#L29-L40", "label": "pgque@v0.2.0 \u00b7 sql/experimental/delayed.sql:29-40"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/experimental/delayed.sql#L58-L65", "label": "pgque@v0.2.0 \u00b7 sql/experimental/delayed.sql:58-65"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/docs/reference.md#L609-L611", "label": "pgque@v0.2.0 \u00b7 docs/reference.md:609-611"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F12", "claim": "\u2026returned only the first max_return events, with no error or warning.", "explanation": "PgQue v0.2.0 stops returning events at max_return without raising overflow. sql/pgque-api/receive.sql:59 contains the exit condition. ack passes the batch identifier to finish_batch at line 75. The correction accurately identifies the unsafe combination.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-api/receive.sql#L58-L60", "label": "pgque@v0.2.0 \u00b7 sql/pgque-api/receive.sql:58-60"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-api/receive.sql#L72-L76", "label": "pgque@v0.2.0 \u00b7 sql/pgque-api/receive.sql:72-76"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F13", "claim": "High-level consumers stop at once on this error.", "explanation": "Version 0.2.2 makes overflow terminal in the high-level clients. Go returns at clients/go/consumer.go:133. TypeScript throws at clients/typescript/src/consumer.ts:93. Python documents propagation before handlers, acknowledgment, or negative acknowledgment at clients/python/pgque/consumer.py:129.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/clients/go/consumer.go#L131-L134", "label": "pgque@v0.2.2 \u00b7 clients/go/consumer.go:131-134"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/clients/typescript/src/consumer.ts#L92-L93", "label": "pgque@v0.2.2 \u00b7 clients/typescript/src/consumer.ts:92-93"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/clients/python/pgque/consumer.py#L129-L131", "label": "pgque@v0.2.2 \u00b7 clients/python/pgque/consumer.py:129-131"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F14", "claim": "\u2026they treated the error as temporary and retried forever\u2026", "explanation": "Version 0.2.1 handles receive errors by logging, sleeping, and continuing. Go implements this at clients/go/consumer.go:129-137. TypeScript implements it at clients/typescript/src/consumer.ts:89-93. Neither branch distinguishes batch overflow from temporary errors.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/32bfbe2119c8fcadf6d49efe886435fdde12500d/clients/go/consumer.go#L129-L137", "label": "pgque@v0.2.1 \u00b7 clients/go/consumer.go:129-137"}, {"url": "https://github.com/NikolayS/pgque/blob/32bfbe2119c8fcadf6d49efe886435fdde12500d/clients/typescript/src/consumer.ts#L89-L93", "label": "pgque@v0.2.1 \u00b7 clients/typescript/src/consumer.ts:89-93"}]}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F15", "claim": "PgQue does not require any binary extensions\u2026", "explanation": "PgQue documents a SQL and PL/pgSQL installation without C extensions in README.md:47. Its external-scheduler path supplies ticking and maintenance without pg_cron. The article\u2019s dependency claim holds under that deployment.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/README.md#L47-L47", "label": "pgque@v0.2.0 \u00b7 README.md:47-47"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/de1ef044-eef6-4ebd-bac0-a15e88b53530#F16", "claim": "Empty batches require no acknowledgment\u2026", "explanation": "receive() calls finish_batch when its returned-event count is zero. PgQue v0.2.0 implements this in sql/pgque-api/receive.sql:62-65. Versions 0.2.1 and 0.2.2 preserve that behavior. Callers need no separate acknowledgment for an empty result.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque-api/receive.sql#L67-L70", "label": "pgque@v0.2.2 \u00b7 sql/pgque-api/receive.sql:67-70"}, {"url": "https://github.com/NikolayS/pgque/blob/e8ee488d2c1d87ab09eed2581ec4bbc1e68315f6/sql/pgque-api/receive.sql#L62-L65", "label": "pgque@v0.2.0 \u00b7 sql/pgque-api/receive.sql:62-65"}]}]}