{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326", "published": "2026-10-21T05:35:11Z", "publisher": "PostgresAI", "article": {"title": "Tutorial", "url": "https://pgque.dev/docs/tutorial", "date_published": "1970-01-01T00:00:00Z", "author": "Not stated", "publisher": "PgQue documentation"}, "grade": "A", "axes": [{"axis": "Factual", "summary": "A \u00b7 0 wrong of 19 checked \u00b7 0 caveats"}, {"axis": "Applicable", "summary": "A \u00b7 0 wrong of 11 checked \u00b7 0 caveats"}, {"axis": "Consistent", "summary": "A \u00b7 0 wrong of 19 checked \u00b7 0 caveats"}, {"axis": "Transparent", "summary": "0 wrong \u00b7 0 caveats \u00b7 1 checked"}, {"axis": "Safe", "summary": "A \u00b7 0 wrong of 10 checked \u00b7 0 caveats"}], "findings": [{"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F1", "claim": "max_return is a complete-batch safety ceiling, not pagination\u2026", "title": "receive rejects oversized batches rather than paginating", "explanation": "receive raises SQLSTATE 54000 when the batch exceeds max_return. sql/pgque.sql:5366-5370 supplies the stated recovery hint. finish_batch advances the whole cursor at lines 5921-5929. The tutorial correctly warns against acknowledging an incomplete processing loop.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5366-L5370", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:5366-5370"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5921-L5929", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:5921-5929"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5326-L5337", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:5326-5337"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F2", "claim": "\u2026coalesce(ev_retry, 0) >= max_retries\u2026", "title": "The retry ceiling and third-nack example match the code", "explanation": "nack defaults max_retries to 5 at sql/pgque.sql:5418. It routes terminal events when the stored count reaches that ceiling. event_retry increments the count at lines 2371-2376. With max_retries=2, the third nack takes the dead-letter branch.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5418-L5421", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:5418-5421"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5440-L5449", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:5440-5449"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2371-L2376", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:2371-2376"}]}, {"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F3", "claim": "PgQue marks batch boundaries with a pg_snapshot\u2026", "explanation": "sql/pgque.sql:140 defaults tick_snapshot to pg_current_snapshot() (E-16). Lines 420-421 require visibility in the current snapshot and exclusion from the previous snapshot (E-17). These predicates support the tutorial's snapshot-based batch explanation.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L140-L140", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:140-140"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L420-L421", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:420-421"}, {"url": "https://github.com/postgres/postgres/blob/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/src/backend/utils/adt/xid8funcs.c#L402-L404", "label": "REL_14_0 \u00b7 src/backend/utils/adt/xid8funcs.c:402-404"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F4", "claim": "The roles are siblings, not parent and child\u2026", "title": "Reader and writer roles have separate memberships", "explanation": "The installer revokes reader membership from writer at sql/pgque.sql:4735-4737. It grants both memberships to admin at lines 4744-4748. The article correctly grants both roles to applications that produce and consume.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4735-L4748", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:4735-4748"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F5", "claim": "pending_events estimates the ticked backlog after the consumer\u2019s finished position\u2026", "explanation": "get_consumer_info subtracts the finished tick's sequence from the latest tick's sequence at sql/pgque.sql:2777-2782 (E-20, E-21). Lag measures the finished tick's age. ev_new subtracts the latest tick's sequence from the current event sequence at line 2646 (E-22).", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2761-L2770", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:2761-2770"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2777-L2782", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:2777-2782"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2646-L2647", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:2646-2647"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F6", "claim": "Queue thresholds still default to 500 events or 3 seconds since the last tick\u2026", "title": "The default scheduler cadence is distinct from queue tick thresholds", "explanation": "Queue defaults are 500 events, 3 seconds of active lag, and 1 minute of idle backoff. sql/pgque.sql:110-112 defines them. tick_period_ms defaults to 100 milliseconds at line 3958. ticker_loop invokes ticker and sleeps between checks. A check does not guarantee a new tick.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L110-L112", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:110-112"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4187-L4202", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:4187-4202"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L3958-L3958", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:3958-3958"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F7", "claim": "\u2026without the ::jsonb cast resolves to the text overload\u2026", "title": "Untyped payload literals select the text overload", "explanation": "PostgreSQL prefers the string category for unknown literals under typeconv.sgml:726-731. PgQue's text overload passes the payload through at sql/pgque.sql:6809-6813. The jsonb overload serializes payload::text at lines 6795-6799. The jsonb comparator orders equal-length keys by bytes.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L6795-L6799", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:6795-6799"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L6809-L6813", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:6809-6813"}, {"url": "https://github.com/postgres/postgres/blob/6b3806732b7c5df06bdd0ed150e8a07b4ad62315/doc/src/sgml/typeconv.sgml#L726-L731", "label": "REL_14_24 \u00b7 doc/src/sgml/typeconv.sgml:726-731"}, {"url": "https://github.com/postgres/postgres/blob/6b3806732b7c5df06bdd0ed150e8a07b4ad62315/src/backend/utils/adt/jsonb_util.c#L1900-L1906", "label": "REL_14_24 \u00b7 src/backend/utils/adt/jsonb_util.c:1900-1906"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F8", "claim": "\u2026each pgque.force_next_tick call advances the event sequence by a large amount\u2026", "title": "force_next_tick advances the sequence without inserting a tick", "explanation": "force_next_tick delegates to force_tick. sql/pgque.sql:5223-5226 advances queue_event_seq by more than the configured event threshold. ticker inserts the boundary at lines 788-789. The article correctly requires a subsequent ticker call.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5223-L5226", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:5223-5226"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L788-L789", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:788-789"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F10", "claim": "Prerequisites: Postgres 14 or newer\u2026", "title": "PostgreSQL 14 is a supported release target", "explanation": "PgQue v0.2.2 includes PostgreSQL 14 in its test matrix. PostgreSQL 14.0 provides pg_current_snapshot in src/include/catalog/pg_proc.dat:9885. We checked the version floor without executing the tutorial.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/.github/workflows/ci.yml#L16-L16", "label": "pgque@v0.2.2 \u00b7 .github/workflows/ci.yml:16-16"}, {"url": "https://github.com/postgres/postgres/blob/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/src/include/catalog/pg_proc.dat#L9885-L9885", "label": "REL_14_0 \u00b7 src/include/catalog/pg_proc.dat:9885-9885"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F11", "claim": "\u2026three roles ( pgque_reader , pgque_writer , pgque_admin )\u2026", "title": "The installer creates the named schema and roles", "explanation": "PgQue v0.2.2 creates the pgque schema at sql/pgque.sql:10. Lines 4706\u20134714 create pgque_reader, pgque_writer, and pgque_admin when absent.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4706-L4714", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:4706-4714"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L10-L10", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:10-10"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F12", "claim": "\u2026create_queue returns 1 when it created the queue, 0 if it already existed\u2026", "title": "Queue creation returns the documented status", "explanation": "PgQue v0.2.2 returns 0 for an existing queue at sql/pgque.sql:1469. Successful creation invokes the ticker and returns 1 at line 1509.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L1467-L1470", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:1467-1470"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L1503-L1509", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:1503-1509"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F13", "claim": "\u2026force_next_tick returns the current last tick id\u2026", "title": "Forcing the next tick advances the sequence and returns the previous tick", "explanation": "PgQue v0.2.2 advances the event sequence at sql/pgque.sql:5224. It returns the latest existing tick ID at line 5237. ticker() increments its result only when a queue creates a tick.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5224-L5237", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:5224-5237"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L818-L822", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:818-822"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F14", "claim": "Third nack: retry_count = 2 . 2 >= 2 is true\u2026", "title": "A retry ceiling of 2 routes the third failure to dead letters", "explanation": "PgQue v0.2.2 compares coalesce(ev_retry, 0) against max_retries at sql/pgque.sql:5440. Retry insertion increments that count at line 2375. A ceiling of 2 permits two retries before dead-letter routing.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5440-L5440", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:5440-5440"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2375-L2375", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:2375-2375"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque-api/receive.sql#L127-L127", "label": "pgque@v0.2.2 \u00b7 sql/pgque-api/receive.sql:127-127"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2375-L2375", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:2375-2375"}]}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F15", "claim": "\u2026it re-enters with a fresh event id\u2026", "title": "Dead-letter replay inserts an event and removes the dead-letter row", "explanation": "PgQue v0.2.2 calls insert_event at sql/pgque.sql:4999. Replay deletes the corresponding dead-letter row at line 5003 and returns the new event ID.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4999-L5005", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:4999-5005"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F16", "claim": "\u2026with no scheduler, the scheduler row reads manual\u2026", "title": "Scheduler status reflects configuration as described", "explanation": "PgQue v0.2.2 substitutes manual for an unset scheduler at sql/pgque.sql:4593. start() stores pg_cron and job IDs at line 4305. It schedules retry maintenance every 30 seconds.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4592-L4598", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:4592-4598"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4305-L4308", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:4305-4308"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4279-L4284", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:4279-4284"}]}, {"anchor": "F17", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F17", "claim": "\u2026To remove PgQue entirely (drops the pgque schema; leaves the roles)\u2026", "title": "Uninstall preserves the three cluster roles", "explanation": "PgQue v0.2.2 drops the schema with CASCADE at sql/pgque.sql:4564. uninstall() leaves pgque_reader, pgque_writer, and pgque_admin.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4564-L4565", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:4564-4565"}]}, {"anchor": "F18", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F18", "claim": "The historical roughly 52 ms median used lowered thresholds and a fast-polling consumer, not default queue settings\u2026", "title": "The historical latency qualification matches the benchmark records", "explanation": "The recorded baseline median is 52.6 ms at benchmark/tick-rate/results-baseline.json:10. bench.py:66 sets ticker_max_lag to 0 seconds. It also sets ticker_idle_period to 0 seconds and ticker_max_count to 1 event.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/benchmark/tick-rate/results-baseline.json#L10-L10", "label": "pgque@v0.2.2 \u00b7 benchmark/tick-rate/results-baseline.json:10-10"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/benchmark/tick-rate/bench.py#L66-L68", "label": "pgque@v0.2.2 \u00b7 benchmark/tick-rate/bench.py:66-68"}, {"url": "https://pgque.dev/docs/latency-and-tuning", "label": "https://pgque.dev/docs/latency-and-tuning"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/benchmark/tick-rate/README.md#L53-L53", "label": "pgque@v0.2.2 \u00b7 benchmark/tick-rate/README.md:53-53"}]}, {"anchor": "F19", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F19", "claim": "\u2026its lag is therefore at least the earlier queue-lag reading\u2026", "title": "The consumer-lag comparison respects the stated condition", "explanation": "get_consumer_info subtracts the finished-position tick time from the current time. get_queue_info uses the latest tick. Without another tick, the later consumer reading cannot have smaller lag.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2761-L2770", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:2761-2770"}, {"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2626-L2632", "label": "pgque@v0.2.2 \u00b7 sql/pgque.sql:2626-2632"}]}, {"anchor": "F20", "url": "https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F20", "claim": "\u2026tick_period_ms=100 (10.00 ticks/sec)\u2026", "title": "The configured rate conversion is correct", "explanation": "A 100 millisecond period corresponds to 10 checks per second (derived: 1,000 milliseconds / 100 milliseconds). status() calculates the displayed rate with this division. The article correctly says this rate does not measure created ticks.", "verdict": "Accurate", "sources": [{"url": "https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque-additions/lifecycle.sql#L466-L466", "label": "pgque@v0.2.2 \u00b7 sql/pgque-additions/lifecycle.sql:466-466"}]}]}