Limited beta · What is this?

pgTrue is under active development: reports may contain significant mistakes, inaccuracies, or bugs. Please report anything you find to pgtrue@postgres.ai.

pgTrue is an independent fact-check of technical Postgres articles. Read the questions and answers.

pgTrue fact-check

ElephantSeal ALimited coverage

Embed

The ElephantSeal always shows this report's latest edition and links here. Copies cached elsewhere may update later.

[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13&theme=light)](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326)
<a href="https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326"><img src="https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13&amp;theme=light" alt="pgTrue fact-check" width="90" height="20" loading="lazy" decoding="async" style="display:inline-block;width:90px;height:20px"></a>
https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13&theme=light
.. image:: https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13&theme=light
   :target: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
   :alt: pgTrue fact-check
   :width: 90
   :height: 20
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13&theme=dark)](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326)
<a href="https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326"><img src="https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13&amp;theme=dark" alt="pgTrue fact-check" width="90" height="20" loading="lazy" decoding="async" style="display:inline-block;width:90px;height:20px"></a>
https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13&theme=dark
.. image:: https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13&theme=dark
   :target: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
   :alt: pgTrue fact-check
   :width: 90
   :height: 20
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13)](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326)
<a href="https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326"><img src="https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13" alt="pgTrue fact-check" width="90" height="20" loading="lazy" decoding="async" style="display:inline-block;width:90px;height:20px"></a>
https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13
.. image:: https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326.svg?v=13
   :target: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
   :alt: pgTrue fact-check
   :width: 90
   :height: 20
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13&theme=light)](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326)
<a href="https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326"><img src="https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13&amp;theme=light" alt="pgTrue fact-check" width="240" height="240" loading="lazy" decoding="async" style="display:inline-block;width:240px;height:240px"></a>
https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13&theme=light
.. image:: https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13&theme=light
   :target: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
   :alt: pgTrue fact-check
   :width: 240
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13&theme=dark)](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326)
<a href="https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326"><img src="https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13&amp;theme=dark" alt="pgTrue fact-check" width="240" height="240" loading="lazy" decoding="async" style="display:inline-block;width:240px;height:240px"></a>
https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13&theme=dark
.. image:: https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13&theme=dark
   :target: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
   :alt: pgTrue fact-check
   :width: 240
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13)](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326)
<a href="https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326"><img src="https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13" alt="pgTrue fact-check" width="240" height="240" loading="lazy" decoding="async" style="display:inline-block;width:240px;height:240px"></a>
https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13
.. image:: https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/radar.svg?v=13
   :target: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
   :alt: pgTrue fact-check
   :width: 240
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13&theme=light)](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326)
<a href="https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326"><img src="https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13&amp;theme=light" alt="pgTrue fact-check" width="480" height="240" loading="lazy" decoding="async" style="display:inline-block;width:480px;height:240px"></a>
https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13&theme=light
.. image:: https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13&theme=light
   :target: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
   :alt: pgTrue fact-check
   :width: 480
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13&theme=dark)](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326)
<a href="https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326"><img src="https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13&amp;theme=dark" alt="pgTrue fact-check" width="480" height="240" loading="lazy" decoding="async" style="display:inline-block;width:480px;height:240px"></a>
https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13&theme=dark
.. image:: https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13&theme=dark
   :target: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
   :alt: pgTrue fact-check
   :width: 480
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13)](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326)
<a href="https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326"><img src="https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13" alt="pgTrue fact-check" width="480" height="240" loading="lazy" decoding="async" style="display:inline-block;width:480px;height:240px"></a>
https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13
.. image:: https://pgtrue.postgres.ai/badge/414d57ed-1e7d-499b-910f-2090217b0326/wide.svg?v=13
   :target: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
   :alt: pgTrue fact-check
   :width: 480
   :height: 240

Click the snippet to select all of it, then copy. Where SVG is stripped, as in some email clients and feed readers, change .svg to .png. PNG uses the light theme for Auto. For Markdown PNG embeds, use the HTML snippet where supported to preserve the display size.

Optional colours: append &color=26798E or &labelColor=333C47 after a theme query (use ? for the first parameter). Use 3- or 6-digit hex.

For pages with a light background.

For pages with a dark background. The ElephantSeal gets a thin edge so it does not blend in.

Auto follows the reader's light or dark setting where the host supports it, and shows the light ElephantSeal where it does not.

On a light page
On a dark page

Tutorial (opens in new tab)

pgque.dev
Sound as far as we checked.
0
inaccuracy
0
dangerous-recipe
0
misleading
0
imprecise
0
transcription
0
aged
0
withdrawn
19
verified-accurate

Factual A · Applicable A · Consistent A · Transparent — · Safe A

ReportTechnical fact-check, edition 3 Issued EditionUpdated after review. Corrections are listed below. SubmittedSubmitted by the PostgresAI team. Author responseNo written reply from the author. The article changed 1 time after our first audit; we re-audited each version. See Revisions below. Policy: right-of-reply and corrections policy. pgTrue versionaudited with v1.0.17 (approx.) · regraded with v1.1.0 (approx.)

InaccuraciesNone in this edition.

Dangerous or recipe bugsNone in this edition.

Misleading / impreciseNone in this edition.

Verified accurate

F1

receive rejects oversized batches rather than paginating

ACCURATEFactual · holds up after review

Claim ledger

Article says
max_return is a complete-batch safety ceiling, not pagination…
What is true
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.
Charitable reading
The tutorial distinguishes capturing one batch identifier from processing every message in that batch.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:5366-5370if cnt = i_max_return then raise exception 'pgque.receive: batch exceeds max_return of %', i_max_return using errcode = '54000', hint = 'Retry with a larger resource-safe max_return to receive the complete batch. Do not acknowledge after this error.';
In the article · section “Step 6: Ack the batch”

In the article

excerpt · section “Step 6: Ack the batch” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Step 6: Ack the batch

For a real batch, process every returned message before acknowledging; do not copy the limit 1 selection as a processing loop. max_return is a complete-batch safety ceiling, not pagination. If receive raises an overflow error, roll back and retry with a sufficient ceiling within your resource budget; never acknowledge the failed receive.

ack ----- 1 (1 row)
All sources and excerpts · 3
Evidence if cnt = i_max_return then raise exception 'pgque.receive: batch exceeds max_return of %', i_max_return using errcode = '54000', hint = 'Retry with a larger resource-safe max_return to receive the complete batch. Do not acknowledge after this error.';
Evidence update pgque.subscription set sub_active = now(), sub_last_tick = sub_next_tick, sub_next_tick = null, sub_batch = null where sub_queue = v_sub.sub_queue and sub_consumer = v_sub.sub_consumer;
Evidence create type pgque.message as ( msg_id bigint, batch_id bigint, type text, payload text, retry_count int4, created_at timestamptz, extra1 text, extra2 text, extra3 text, extra4 text );
How the review tested this

Review: We checked for an off-by-one error and pagination behavior. receive raises on the next event after reaching max_return. finish_batch advances the entire cursor. We tested whether max_return truncates a batch. The overflow branch raises 54000, and acknowledgment advances the whole cursor.

F2

The retry ceiling and third-nack example match the code

ACCURATEFactual · holds up after review

Claim ledger

Article says
…coalesce(ev_retry, 0) >= max_retries…
What is true
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.
Charitable reading
The ceiling counts redeliveries. It does not count the initial delivery as retry 1.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:5418-5421select coalesce(q.queue_max_retries, 5) into v_max_retries from pgque.subscription s join pgque.queue q on q.queue_id = s.sub_queue where s.sub_batch = i_batch_id;
In the article · section “Step 8: Drive the bad order into the dead-letter queue”

In the article

excerpt · section “Step 8: Drive the bad order into the dead-letter queue” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Step 8: Drive the bad order into the dead-letter queue

nack routes a message to the dead-letter queue when its stored retry count has reached the ceiling — specifically when coalesce(ev_retry, 0) >= max_retries . Walk the arithmetic with max_retries = 2 :

All sources and excerpts · 3
Evidence select coalesce(q.queue_max_retries, 5) into v_max_retries from pgque.subscription s join pgque.queue q on q.queue_id = s.sub_queue where s.sub_batch = i_batch_id;
Evidence if coalesce(v_ev.ev_retry, 0) >= v_max_retries then -- Move to dead letter queue using canonical event data (#98). -- event_dead() uses ON CONFLICT DO NOTHING for idempotency (#104). -- ev_txid is bigint in get_batch_events (legacy PgQ signature); text -- round-trip is the codebase convention to widen to xid8 without loss. perform pgque.event_dead(i_batch_id, v_ev.ev_id, coalesce(i_reason, 'max retries exceeded'), v_ev.ev_time, v_ev.ev_txid::text::xid8, v_ev.ev_retry, v_ev.ev_type, v_ev.ev_data, v_ev.ev_extra1, v_ev.ev_extra2, v_ev.ev_extra3, v_ev.ev_extra4);
Evidence insert into pgque.retry_queue (ev_retry_after, ev_queue, ev_id, ev_time, ev_txid, ev_owner, ev_retry, ev_type, ev_data, ev_extra1, ev_extra2, ev_extra3, ev_extra4) select x_retry_time, sub_queue, ev_id, ev_time, NULL, sub_id, coalesce(ev_retry, 0) + 1, ev_type, ev_data, ev_extra1, ev_extra2, ev_extra3, ev_extra4
How the review tested this

Review: We tested whether the initial delivery counts as retry 1. The comparison uses zero initially, and retry insertion increments it. The third nack reaches 2. We checked for an off-by-one error. The stored count increments on retry, so a ceiling of 2 routes the third nack.

F3

Verified accurate: “PgQue marks batch boundaries with a pg_snapshot…”

ACCURATEFactual · partly holds after review

Claim ledger

Article says
PgQue marks batch boundaries with a pg_snapshot…
What is true
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.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:140-140tick_snapshot pg_snapshot not null default pg_current_snapshot(),
In the article · section “Step 5: Force the next tick, then receive”

In the article

excerpt · section “Step 5: Force the next tick, then receive” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Step 5: Force the next tick, then receive

Each statement above runs in its own transaction. This is required, not stylistic. PgQue marks batch boundaries with a pg_snapshot : the ticker captures a snapshot, and receive only returns events whose send committed before that snapshot. An event sent in the same transaction as the tick is still in-progress at snapshot time and is excluded from the batch. Wrapping send + force_next_tick + ticker + receive in one begin / commit returns zero rows. In psql autocommit, each select is already its own transaction — just do not wrap them.

select * from pgque . receive ( ' orders ' , ' processor ' , 100 );
All sources and excerpts · 3
Evidence tick_snapshot pg_snapshot not null default pg_current_snapshot(),
Evidence || ' and pg_visible_in_snapshot(ev.ev_txid, cur.tick_snapshot)' || ' and not pg_visible_in_snapshot(ev.ev_txid, last.tick_snapshot)'
Evidence cur = GetActiveSnapshot(); if (cur == NULL) elog(ERROR, "no active snapshot set");

Version note: PostgreSQL 14.0 version floor.

How the review tested this

Review: The snapshot mechanism survives. E-18 quotes only active-snapshot retrieval and its error branch. That excerpt does not establish the claimed PostgreSQL 14.0 snapshot API. We removed the broader compatibility assertion.

F4

Reader and writer roles have separate memberships

ACCURATEFactual · holds up after review

Claim ledger

Article says
The roles are siblings, not parent and child…
What is true
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.
Charitable reading
The sibling description concerns reader and writer. The article separately describes admin inheriting both.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:4735-4748 if pg_has_role('pgque_writer', 'pgque_reader', 'member') then revoke pgque_reader from pgque_writer; end if; end $$; -- Grant role hierarchy idempotently. Use explicit membership checks instead -- of GRANT IF NOT EXISTS so this stays compatible with PG14/15. do $$ begin if not pg_has_role('pgque_admin', 'pgque_reader', 'member') then grant pgque_reader to pgque_admin; end if; if not pg_has_role('pgque_admin', 'pgque_writer', 'member') then grant pgque_writer to pgque_admin;
In the article · section “Step 1: Install”

In the article

excerpt · section “Step 1: Install” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Step 1: Install

The install creates the pgque schema, three roles ( pgque_reader , pgque_writer , pgque_admin ), and every function you call in the rest of this tutorial. The roles are siblings, not parent and child: pgque_writer produces ( send , send_batch ); pgque_reader consumes ( subscribe , receive , ack , nack ); pgque_admin is a member of both.

-- produce and consume: grant pgque_reader, pgque_writer to app_orders; -- produce only: grant pgque_writer to app_webhook; -- consume only (dashboard, metrics): grant pgque_reader to metrics;
All sources and excerpts · 1
Evidence if pg_has_role('pgque_writer', 'pgque_reader', 'member') then revoke pgque_reader from pgque_writer; end if; end $$; -- Grant role hierarchy idempotently. Use explicit membership checks instead -- of GRANT IF NOT EXISTS so this stays compatible with PG14/15. do $$ begin if not pg_has_role('pgque_admin', 'pgque_reader', 'member') then grant pgque_reader to pgque_admin; end if; if not pg_has_role('pgque_admin', 'pgque_writer', 'member') then grant pgque_writer to pgque_admin;
How the review tested this

Review: We tested whether admin membership contradicts the sibling description. The article separately explains admin inheritance. The installer separates writer from reader and grants both to admin. We tested the sibling description against admin membership. The surrounding text distinguishes admin, and the installer grants admin both roles.

F5

Verified accurate: “pending_events estimates the ticked backlog after the consumer’s finished position…”

ACCURATEFactual · partly holds after review

Claim ledger

Article says
pending_events estimates the ticked backlog after the consumer’s finished position…
What is true
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).

Source

Source · pgque@v0.2.2 · sql/pgque.sql:2761-2770select q.queue_name, c.co_name, current_timestamp - t.tick_time, current_timestamp - s.sub_active, s.sub_last_tick, s.sub_batch, s.sub_next_tick, t.tick_event_seq, q.queue_id from pgque.queue q, pgque.consumer c, pgque.subscription s left join pgque.tick t on (t.tick_queue = s.sub_queue and t.tick_id = s.sub_last_tick)
In the article · section “Step 9: Check queue and consumer health”

In the article

excerpt · section “Step 9: Check queue and consumer health” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Step 9: Check queue and consumer health

pending_events estimates the ticked backlog after the consumer’s finished position. It subtracts that position’s saved event sequence from the latest tick’s sequence. It does not count events waiting for the next tick, and it is not an exact unread-row count: forced ticks and sequence gaps can inflate it. A zero value does not prove that no message is waiting. The queue’s ev_new is the sequence-based estimate for activity after the latest tick.

All sources and excerpts · 3
Evidence select q.queue_name, c.co_name, current_timestamp - t.tick_time, current_timestamp - s.sub_active, s.sub_last_tick, s.sub_batch, s.sub_next_tick, t.tick_event_seq, q.queue_id from pgque.queue q, pgque.consumer c, pgque.subscription s left join pgque.tick t on (t.tick_queue = s.sub_queue and t.tick_id = s.sub_last_tick)
Evidence select t.tick_event_seq - _pending_events into pending_events from pgque.tick t where t.tick_queue = _queue_id order by t.tick_queue desc, t.tick_id desc limit 1;
Evidence ev_new = pgque.seq_getval(_queue_event_seq) - _top_tick_event_seq; last_tick_id = _top_tick_id;
How the review tested this

Review: We checked which sequence values the subtraction uses. E-20 through E-22 support backlog and lag calculations. They do not show forced sequence advances. We removed that additional explanation from this finding.

F6

The default scheduler cadence is distinct from queue tick thresholds

ACCURATEFactual · holds up after review

Claim ledger

Article says
Queue thresholds still default to 500 events or 3 seconds since the last tick…
What is true
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.
Charitable reading
The 3-second threshold concerns active queues. The article separately explains idle backoff and scheduler delay.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:110-112queue_ticker_max_count integer not null default 500, queue_ticker_max_lag interval not null default '3 seconds', queue_ticker_idle_period interval not null default '1 minute',
In the article · section “Where to go from here”

In the article

excerpt · section “Where to go from here” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Where to go from here

You have driven the ticker by hand all the way through. In production, select pgque.start(); schedules pg_cron to run the ticker and maintenance jobs. The default 100 ms interval is a check cadence, not a delivery guarantee. Queue thresholds still default to 500 events or 3 seconds since the last tick. The historical roughly 52 ms median used lowered thresholds and a fast-polling consumer, not default queue settings. See Latency and tick tuning before choosing settings for your workload.

select pgque . drop_queue ( ' orders ' , true); -- force=true unregisters the consumer first
All sources and excerpts · 3
Evidence queue_ticker_max_count integer not null default 500, queue_ticker_max_lag interval not null default '3 seconds', queue_ticker_idle_period interval not null default '1 minute',
Evidence v_iter_budget := greatest(1, v_window_ms / v_period_ms); for i in 1 .. v_iter_budget loop perform pgque.ticker(); commit; if i = v_iter_budget then exit; end if; v_elapsed_ms := extract(epoch from (clock_timestamp() - v_started_at)) * 1000.0; if v_elapsed_ms + v_period_ms >= v_window_ms then exit; end if; perform pg_sleep(v_period_ms / 1000.0);
Evidence tick_period_ms integer not null default 100
How the review tested this

Review: We checked whether 100 milliseconds guarantees a tick and whether idle behavior contradicts the finding. Queue thresholds govern creation. The article explicitly distinguishes idle backoff. We tested whether 100 milliseconds guarantees delivery. The loop checks the ticker, while separate queue settings define tick thresholds.

F7

Untyped payload literals select the text overload

ACCURATEFactual · holds up after review

Claim ledger

Article says
…without the ::jsonb cast resolves to the text overload…
What is true
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.
Charitable reading
The article distinguishes an unknown SQL literal from an explicit jsonb cast.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:6795-6799create or replace function pgque.send(queue_name text, payload jsonb) returns bigint as $$ begin return pgque.insert_event(queue_name, 'default', payload::text); end;
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)…without the ::jsonb cast resolves to the text overload…
All sources and excerpts · 4
Evidencecreate or replace function pgque.send(queue_name text, payload jsonb) returns bigint as $$ begin return pgque.insert_event(queue_name, 'default', payload::text); end;
Evidencecreate or replace function pgque.send(queue_name text, payload text) returns bigint as $$ begin return pgque.insert_event(queue_name, 'default', payload); end;
EvidenceIf any input arguments are <type>unknown</type>, check the type categories accepted at those argument positions by the remaining candidates. At each position, select the <type>string</type> category if any candidate accepts that category. (This bias towards string is appropriate since an unknown-type literal looks like a string.)
EvidencelengthCompareJsonbString(const char *val1, int len1, const char *val2, int len2) { if (len1 == len2) return memcmp(val1, val2, len1); else return len1 > len2 ? 1 : -1; }
How the review tested this

Review: We checked overload ambiguity and key ordering. PostgreSQL prefers the string category for unknown literals. The comparator orders equal-length keys by bytes, as the finding states. We checked whether JSON-looking text selects jsonb automatically. Unknown literals prefer the string category, and the text overload passes payloads unchanged.

F8

force_next_tick advances the sequence without inserting a tick

ACCURATEFactual · holds up after review

Claim ledger

Article says
…each pgque.force_next_tick call advances the event sequence by a large amount…
What is true
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.
Charitable reading
The numeric examples are illustrative. The article warns that forced ticks change sequence-derived values.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:5223-5226-- Bump event-seq past ticker_max_count so the next pgque.ticker() run ticks. perform setval(queue_event_seq, nextval(queue_event_seq) + v_max_count * 2 + 1000) from pgque.queue where queue_id = v_queue_id;
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)…each pgque.force_next_tick call advances the event sequence by a large amount…
All sources and excerpts · 2
Evidence -- Bump event-seq past ticker_max_count so the next pgque.ticker() run ticks. perform setval(queue_event_seq, nextval(queue_event_seq) + v_max_count * 2 + 1000) from pgque.queue where queue_id = v_queue_id;
Evidence insert into pgque.tick (tick_queue, tick_id, tick_event_seq) values (q.queue_id, nextval(q.queue_tick_seq), q.event_seq);
How the review tested this

Review: We inspected force_tick for a hidden tick insertion. It advances the event sequence. The separate ticker function inserts the boundary. We checked whether forcing inserts a tick directly. It advances the event sequence, while ticker performs the boundary insertion.

F10

PostgreSQL 14 is a supported release target

ACCURATEFactual · holds up after review

Claim ledger

Article says
Prerequisites: Postgres 14 or newer…
What is true
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.
Charitable reading
The prerequisite names a supported floor. It does not claim these PostgreSQL APIs first appeared in version 14.

Source

Source · pgque@v0.2.2 · .github/workflows/ci.yml:16-16pg_version: ['18', '17', '16', '15', '14']
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)Prerequisites: Postgres 14 or newer…
All sources and excerpts · 2
Evidence pg_version: ['18', '17', '16', '15', '14']
Evidence proname => 'pg_current_snapshot', provolatile => 's',

Version note: Checked the article's PostgreSQL 14 floor.

How the review tested this

Review: We checked whether PostgreSQL 14 support rests only on a later patch release. The 14.0 catalog contains the API. PgQue v0.2.2 explicitly includes 14 in its test matrix. We checked whether support for PostgreSQL 14 was inferred from newer APIs. The release explicitly tests 14, whose catalog contains pg_current_snapshot.

F11

The installer creates the named schema and roles

ACCURATEFactual · holds up after review

Claim ledger

Article says
…three roles ( pgque_reader , pgque_writer , pgque_admin )…
What is true
PgQue v0.2.2 creates the pgque schema at sql/pgque.sql:10. Lines 4706–4714 create pgque_reader, pgque_writer, and pgque_admin when absent.
Charitable reading
The installer creates missing roles and preserves existing roles.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:4706-4714if not exists (select from pg_roles where rolname = 'pgque_reader') then create role pgque_reader; end if; if not exists (select from pg_roles where rolname = 'pgque_writer') then create role pgque_writer; end if; if not exists (select from pg_roles where rolname = 'pgque_admin') then create role pgque_admin; end if;
In the article · section “Step 1: Install”

In the article

excerpt · section “Step 1: Install” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Step 1: Install

The install creates the pgque schema, three roles ( pgque_reader , pgque_writer , pgque_admin ), and every function you call in the rest of this tutorial. The roles are siblings, not parent and child: pgque_writer produces ( send , send_batch ); pgque_reader consumes ( subscribe , receive , ack , nack ); pgque_admin is a member of both.

-- produce and consume: grant pgque_reader, pgque_writer to app_orders; -- produce only: grant pgque_writer to app_webhook; -- consume only (dashboard, metrics): grant pgque_reader to metrics;
All sources and excerpts · 2
Evidence if not exists (select from pg_roles where rolname = 'pgque_reader') then create role pgque_reader; end if; if not exists (select from pg_roles where rolname = 'pgque_writer') then create role pgque_writer; end if; if not exists (select from pg_roles where rolname = 'pgque_admin') then create role pgque_admin; end if;
Evidencecreate schema if not exists pgque;
How the review tested this

Review: We checked existing-role behavior against the creation claim. The finding preserves the qualification that roles are created when absent. All three names and the schema match. We checked existing-role behavior. Conditional creation preserves existing roles and creates each missing role, as the finding states.

F12

Queue creation returns the documented status

ACCURATEFactual · holds up after review

Claim ledger

Article says
…create_queue returns 1 when it created the queue, 0 if it already existed…
What is true
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.
Charitable reading
Idempotence describes repeating creation for an existing queue. It does not promise concurrent creation cannot race.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:1467-1470perform 1 from pgque.queue where queue_name = i_queue_name; if found then return 0; end if;
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)…create_queue returns 1 when it created the queue, 0 if it already existed…
All sources and excerpts · 2
Evidence perform 1 from pgque.queue where queue_name = i_queue_name; if found then return 0; end if;
Evidence perform pgque.grant_perms(i_queue_name); perform pgque.ticker(i_queue_name); perform pgque.tune_storage(i_queue_name); return 1;
How the review tested this

Review: We checked both return branches and considered concurrent creation. The finding asserts sequential status behavior, not race-free creation. Existing queues return 0, and successful creation returns 1. We tested the idempotence wording against concurrent creation. The finding limits its conclusion to documented return branches and makes no concurrency guarantee.

F13

Forcing the next tick advances the sequence and returns the previous tick

ACCURATEFactual · holds up after review

Claim ledger

Article says
…force_next_tick returns the current last tick id…
What is true
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.
Charitable reading
The guarantee applies to the tutorial's new, unpaused queue using its internal ticker.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:5224-5237perform setval(queue_event_seq, nextval(queue_event_seq) + v_max_count * 2 + 1000) from pgque.queue where queue_id = v_queue_id; -- Return the current last tick id (the one before force_tick took effect). -- If the queue has no ticks yet, returns NULL — same as the upstream -- behavior on a brand-new queue. select tick_id into v_max_tick from pgque.tick where tick_queue = v_queue_id order by tick_id desc limit 1; return v_max_tick;
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)…force_next_tick returns the current last tick id…
All sources and excerpts · 2
Evidence perform setval(queue_event_seq, nextval(queue_event_seq) + v_max_count * 2 + 1000) from pgque.queue where queue_id = v_queue_id; -- Return the current last tick id (the one before force_tick took effect). -- If the queue has no ticks yet, returns NULL — same as the upstream -- behavior on a brand-new queue. select tick_id into v_max_tick from pgque.tick where tick_queue = v_queue_id order by tick_id desc limit 1; return v_max_tick;
Evidence if pgque.ticker(q.queue_name) > 0 then res := res + 1; end if; end loop; return res;
How the review tested this

Review: We checked whether forcing returns a newly created tick. It selects the latest existing tick after advancing the sequence. ticker counts only queues that produce a tick. We checked whether forcing returns a newly created tick. It selects the latest existing tick, and ticker counts successful queue ticks.

F14

A retry ceiling of 2 routes the third failure to dead letters

ACCURATEFactual · holds up after review

Claim ledger

Article says
Third nack: retry_count = 2 . 2 >= 2 is true…
What is true
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.
Charitable reading
The count represents completed retries. The initial delivery has a null count.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:5440-5440if coalesce(v_ev.ev_retry, 0) >= v_max_retries then
In the article · section “Step 8: Drive the bad order into the dead-letter queue”

In the article

excerpt · section “Step 8: Drive the bad order into the dead-letter queue” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Step 8: Drive the bad order into the dead-letter queue

Third nack: retry_count = 2 . 2 >= 2 is true → the message goes to pgque.dead_letter instead of the retry queue.

All sources and excerpts · 4
Evidence if coalesce(v_ev.ev_retry, 0) >= v_max_retries then
Evidence ev_id, ev_time, NULL, sub_id, coalesce(ev_retry, 0) + 1,
Evidence if coalesce(v_ev.ev_retry, 0) >= v_max_retries then
Evidence ev_id, ev_time, NULL, sub_id, coalesce(ev_retry, 0) + 1,
How the review tested this

Review: We recalculated the three comparisons using counts 0, 1, and 2. Only the third reaches the ceiling. The standalone API and combined installer agree. We recomputed the three failures from counts 0, 1, and 2. Only the third count satisfies the terminal comparison.

F15

Dead-letter replay inserts an event and removes the dead-letter row

ACCURATEFactual · holds up after review

Claim ledger

Article says
…it re-enters with a fresh event id…
What is true
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.
Charitable reading
Replay creates a new queue event rather than restoring the original event ID.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:4999-5005v_new_eid := pgque.insert_event(v_dl.queue_name, v_dl.ev_type, v_dl.ev_data, v_dl.ev_extra1, v_dl.ev_extra2, v_dl.ev_extra3, v_dl.ev_extra4); -- Remove from DLQ delete from pgque.dead_letter where dl_id = i_dead_letter_id; return v_new_eid;
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)…it re-enters with a fresh event id…
All sources and excerpts · 1
Evidence v_new_eid := pgque.insert_event(v_dl.queue_name, v_dl.ev_type, v_dl.ev_data, v_dl.ev_extra1, v_dl.ev_extra2, v_dl.ev_extra3, v_dl.ev_extra4); -- Remove from DLQ delete from pgque.dead_letter where dl_id = i_dead_letter_id; return v_new_eid;
How the review tested this

Review: We checked whether replay restores the original ID or retains the dead-letter row. Replay calls insert_event without that ID, deletes the dead-letter row, and returns the insertion result. We checked whether replay preserves the original identifier or leaves the dead-letter row. It inserts an event and deletes that row.

F16

Scheduler status reflects configuration as described

ACCURATEFactual · holds up after review

Claim ledger

Article says
…with no scheduler, the scheduler row reads manual…
What is true
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.
Charitable reading
The article describes configured scheduler state. It does not treat scheduled as proof of successful execution.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:4592-4598select 'scheduler'::text, coalesce(c.scheduler, 'manual')::text, format('ticker_job_id=%s, maint_job_id=%s, tick_period_ms=%s (%s ticks/sec)', coalesce(c.ticker_job_id::text, 'NULL'), coalesce(c.maint_job_id::text, 'NULL'), c.tick_period_ms, (1000.0 / c.tick_period_ms)::numeric(10, 2))
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)…with no scheduler, the scheduler row reads manual…
All sources and excerpts · 3
Evidence select 'scheduler'::text, coalesce(c.scheduler, 'manual')::text, format('ticker_job_id=%s, maint_job_id=%s, tick_period_ms=%s (%s ticks/sec)', coalesce(c.ticker_job_id::text, 'NULL'), coalesce(c.maint_job_id::text, 'NULL'), c.tick_period_ms, (1000.0 / c.tick_period_ms)::numeric(10, 2))
Evidence update pgque.config set ticker_job_id = v_ticker_id, maint_job_id = v_maint_id, scheduler = 'pg_cron';
Evidence select cron.schedule_in_database( 'pgque_retry_events', '30 seconds', $sql$set statement_timeout = '25s'; select pgque.maint_retry_events()$sql$, v_dbname ) into v_retry_id;
How the review tested this

Review: We checked whether the finding confuses configured scheduling with successful execution. It describes configuration only. The manual fallback, pg_cron assignment, and 30-second retry schedule match. We tested whether configured scheduling was confused with successful execution. The finding describes configuration and correctly identifies the 30-second retry schedule.

F17

Uninstall preserves the three cluster roles

ACCURATEFactual · holds up after review

Claim ledger

Article says
…To remove PgQue entirely (drops the pgque schema; leaves the roles)…
What is true
PgQue v0.2.2 drops the schema with CASCADE at sql/pgque.sql:4564. uninstall() leaves pgque_reader, pgque_writer, and pgque_admin.
Charitable reading
Complete removal refers to database objects. The article explicitly excludes cluster roles.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:4564-4565drop schema pgque cascade; -- Note: roles are not dropped here (they may be in use by other databases)
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)…To remove PgQue entirely (drops the pgque schema; leaves the roles)…
All sources and excerpts · 1
Evidence drop schema pgque cascade; -- Note: roles are not dropped here (they may be in use by other databases)
How the review tested this

Review: We checked whether CASCADE also removes cluster roles. The uninstall statement drops the schema. Its adjacent comment explicitly preserves roles. We checked whether schema removal also removes cluster roles. The uninstall code drops the schema and explicitly preserves roles.

F18

The historical latency qualification matches the benchmark records

ACCURATEFactual · holds up after review

Claim ledger

Article says
The historical roughly 52 ms median used lowered thresholds and a fast-polling consumer, not default queue settings…
What is true
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.
Charitable reading
The article labels 52 ms as historical tuned performance. It does not promise that latency with default thresholds.

Source

Source · pgque@v0.2.2 · benchmark/tick-rate/results-baseline.json:10-10"p50_ms": 52.60300636291504,
In the article · section “Where to go from here”

In the article

excerpt · section “Where to go from here” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Where to go from here

You have driven the ticker by hand all the way through. In production, select pgque.start(); schedules pg_cron to run the ticker and maintenance jobs. The default 100 ms interval is a check cadence, not a delivery guarantee. Queue thresholds still default to 500 events or 3 seconds since the last tick. The historical roughly 52 ms median used lowered thresholds and a fast-polling consumer, not default queue settings. See Latency and tick tuning before choosing settings for your workload.

select pgque . drop_queue ( ' orders ' , true); -- force=true unregisters the consumer first
All sources and excerpts · 4
Evidence "p50_ms": 52.60300636291504,

Version note: Recorded benchmark output, independently unmeasured.

Evidence cur.execute("select pgque.set_queue_config(%s, 'ticker_max_lag', '0 seconds')", (queue,)) cur.execute("select pgque.set_queue_config(%s, 'ticker_idle_period', '0 seconds')", (queue,)) cur.execute("select pgque.set_queue_config(%s, 'ticker_max_count', '1')", (queue,))
EvidenceThe historical benchmark used tick_period_ms = 100 , lowered queue thresholds, and a fast-polling consumer.
Evidence| 100 | 100 | 3000 | 3000 | 52.62 | 98.86 | 103.48 | 105.28 | 52.74 |
How the review tested this

Review: We checked whether the finding presents recorded latency as independently measured performance. It explicitly describes recorded results. The benchmark configuration lowers thresholds, and the documentation identifies fast polling. We checked whether the finding presents 52.6 milliseconds as independently measured or default performance. It identifies recorded results and lowered thresholds.

F19

The consumer-lag comparison respects the stated condition

ACCURATEFactual · holds up after review

Claim ledger

Article says
…its lag is therefore at least the earlier queue-lag reading…
What is true
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.
Charitable reading
The comparison assumes no intervening tick and follows the displayed queries in order.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:2761-2770current_timestamp - t.tick_time,
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)…its lag is therefore at least the earlier queue-lag reading…
All sources and excerpts · 2
Evidence current_timestamp - t.tick_time,
Evidence select (current_timestamp - t.tick_time),
How the review tested this

Review: We applied the stated no-intervening-tick condition and checked query order. Consumer lag uses its finished tick. The displayed 3.510 seconds exceeds the earlier 3.412-second queue reading. We checked the inequality under its no-intervening-tick condition. Both functions use tick timestamps, and 3.510 seconds exceeds 3.412 seconds.

F20

The configured rate conversion is correct

ACCURATEFactual · holds up after review

Claim ledger

Article says
…tick_period_ms=100 (10.00 ticks/sec)…
What is true
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.
Charitable reading
The article explicitly distinguishes the configured rate from measured tick creation.

Source

Source · pgque@v0.2.2 · sql/pgque-additions/lifecycle.sql:466-466(1000.0 / c.tick_period_ms)::numeric(10, 2))
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)…tick_period_ms=100 (10.00 ticks/sec)…
All sources and excerpts · 1
Evidence (1000.0 / c.tick_period_ms)::numeric(10, 2))
How the review tested this

Review: We recalculated 1,000 milliseconds divided by 100 milliseconds and checked the status expression. Both yield 10 checks per second. The article disclaims measured tick throughput. We recomputed 1,000 milliseconds divided by 100 milliseconds. The result is 10 checks per second, matching the status calculation.

Notes

1 not graded: findings no reader would act on differently
F9

force_next_tick and ticker can share a transaction

NOTEholds up after review

Claim ledger

Article says
Each statement above runs in its own transaction. This is required, not stylistic…
What is true
The requirement for a transaction per statement is too broad. force_tick changes the sequence at sql/pgque.sql:5223-5226. ticker reads that sequence and inserts a tick at lines 788-789. Those calls can share a transaction after send commits. The tutorial's separate statements remain safe.
So what
Commit send before the ticker snapshot. Combine force_next_tick and ticker in one transaction when useful.
Charitable reading
Autocommit is a safe tutorial convention. Keeping send and ticker separate protects the intended snapshot boundary.

Source

Source · pgque@v0.2.2 · sql/pgque.sql:140-140tick_snapshot pg_snapshot not null default pg_current_snapshot(),

Not graded: no reader would act differently on it.

In the article · section “Step 5: Force the next tick, then receive”

In the article

excerpt · section “Step 5: Force the next tick, then receive” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Step 5: Force the next tick, then receive

Each statement above runs in its own transaction. This is required, not stylistic. PgQue marks batch boundaries with a pg_snapshot : the ticker captures a snapshot, and receive only returns events whose send committed before that snapshot. An event sent in the same transaction as the tick is still in-progress at snapshot time and is excluded from the batch. Wrapping send + force_next_tick + ticker + receive in one begin / commit returns zero rows. In psql autocommit, each select is already its own transaction — just do not wrap them.

select * from pgque . receive ( ' orders ' , ' processor ' , 100 );
All sources and excerpts · 3
Evidence tick_snapshot pg_snapshot not null default pg_current_snapshot(),
Evidence -- Bump event-seq past ticker_max_count so the next pgque.ticker() run ticks. perform setval(queue_event_seq, nextval(queue_event_seq) + v_max_count * 2 + 1000) from pgque.queue where queue_id = v_queue_id;
Evidence insert into pgque.tick (tick_queue, tick_id, tick_event_seq) values (q.queue_id, nextval(q.queue_tick_seq), q.event_seq);
How the review tested this

Review: We read the requirement as advice to commit send first. Its immediate scope also includes force_next_tick and ticker. Their sequence operations require no intervening commit. A note remains proportionate. We read the requirement as safe tutorial guidance. Its literal transaction requirement remains broader than necessary, and note severity preserves that distinction.

More in this report

Section checks · 11 sections

Section checks

AspectGradeFindingsCoverage
IntroductionA1 verified-accurate100% of claims (8 of 8, plus 1 that need data we do not have)
InstallA2 verified-accurate87% of claims (14 of 16)
Queues and consumersA1 verified-accurate87% of claims (7 of 8)
SendingA1 verified-accurate60% of claims (3 of 5)
Forcing ticks and snapshotsA3 verified-accurate87% of claims (14 of 16, plus 2 that need data we do not have)
AcknowledgmentA1 verified-accurate95% of claims (19 of 20, plus 2 that need data we do not have)
RetriesA1 verified-accurate95% of claims (20 of 21, plus 2 that need data we do not have)
Dead-letter queueA2 verified-accurate90% of claims (19 of 21, plus 2 that need data we do not have)
Queue and consumer healthA2 verified-accurate72% of claims (18 of 25)
StatusA2 verified-accurate100% of claims (10 of 10, plus 1 that need data we do not have)
Production and teardownA3 verified-accurate100% of claims (7 of 7)
Coverage and assessment · Checked 148 of 167 Postgres claims across 13 sections; 1 section below half

A — the findings address the article's main subject. What we did not check is listed below. We checked PgQue v0.2.2 installation, snapshot delivery, acknowledgment, retries, dead-letter handling, and health calculations against source.

We did not check everything in this article. What we did not check is listed below, in the words we recorded at the time. None of it moved the letter. We never charge our own limits to the article.

What we did not check

  • We did not reproduce the displayed SQL outputs.
  • We did not check how pg_timetable initializes its database schema.
  • We did not reproduce the SQL sessions or latency measurements the article displays.
  • We did not verify compatibility with every managed PostgreSQL service.
  • We did not complete checks of producer concurrency, event-ID uniqueness, payload formats, or installation-owner privileges.
  • We did not complete checks of replay visibility, purge boundaries, or the health-metric explanations.
  • We did not establish the article's publication date or assess changes since publication.
  • We could not retrieve the article's edit-page link.
  • We did not reproduce the tutorial outputs or the historical latency measurements.
  • Section “Further reading”: we checked 0 of 1 checkable claims.
Checked 148 of 167 Postgres claims across 13 sections; 1 section below half
  • Introduction: 8 of 8 Postgres claims checked, plus 1 that need data we do not have; not counted: 2 product or opinion, 1 not a claim
  • Install: 14 of 16 Postgres claims checked; not checked: 2 for other reasons
  • Queues and consumers: 7 of 8 Postgres claims checked; not checked: 1 for other reasons
  • Sending: 3 of 5 Postgres claims checked; not checked: 2 for other reasons
  • Receiving before a tick: 9 of 9 Postgres claims checked
  • Forcing ticks and snapshots: 14 of 16 Postgres claims checked, plus 2 that need data we do not have; not checked: 2 for other reasons
  • Acknowledgment: 19 of 20 Postgres claims checked, plus 2 that need data we do not have; not checked: 1 for other reasons
  • Retries: 20 of 21 Postgres claims checked, plus 2 that need data we do not have; not counted: 2 duplicate; not checked: 1 for other reasons
  • Dead-letter queue: 19 of 21 Postgres claims checked, plus 2 that need data we do not have; not checked: 2 for other reasons
  • Queue and consumer health: 18 of 25 Postgres claims checked; not counted: 1 not a claim; not checked: 7 for other reasons
  • Status: 10 of 10 Postgres claims checked, plus 1 that need data we do not have; not counted: 1 product or opinion
  • Production and teardown: 7 of 7 Postgres claims checked; not counted: 2 not a claim
  • Further reading: 0 of 1 Postgres claims checked; not counted: 1 product or opinion, 5 not a claim; not checked: 1 for other reasons

Average of 4 axes: 4 · result A

Some explanatory text is not shown in this edition; the grade and findings are complete.

Scorecard · the five axes
FACTS scorecard Scorecard radar, 5 axes, bigger is better. Overall A. Factual A · 0 wrong of 19 checked · 0 caveats. Applicable A · 0 wrong of 11 checked · 0 caveats. Consistent A · 0 wrong of 19 checked · 0 caveats. Transparent 1 checked, too few for a letter. Safe A · 0 wrong of 10 checked · 0 caveats. A 0 wrong of 19 checked · 0 caveatsFactual A0 wrong of 190 caveats A 0 wrong of 11 checked · 0 caveatsApplicable A0 wrong of 110 caveats A 0 wrong of 19 checked · 0 caveatsConsistent A0 wrong of 190 caveats 1 checked, too few for a letterTransparent n/a0 wrong of 10 caveats A 0 wrong of 10 checked · 0 caveatsSafe A0 wrong of 100 caveats

By topic: Introduction — 1 finding, 0 wrong · Install — 2 findings, 0 wrong · Queues and consumers — 1 finding, 0 wrong · Sending — 1 finding, 0 wrong · Forcing ticks and snapshots — 3 findings, 0 wrong · Acknowledgment — 1 finding, 0 wrong · Retries — 1 finding, 0 wrong · Dead-letter queue — 2 findings, 0 wrong · Queue and consumer health — 2 findings, 0 wrong · Status — 2 findings, 0 wrong · Production and teardown — 3 findings, 0 wrong

Further out is better. Each axis has its own letter, from the wrong claims and caveats among the claims we checked of that kind.

Checked on the FACTS: Factual, Applicable, Consistent, Transparent, Safe. Clockwise: Factual (is it true?), Applicable (does it apply to my setup, today?), Consistent (does it agree with itself?), Transparent (can I check it myself?), Safe (can I run this on prod?).

We checked 19 claims, 39 commands scanned.

AxisLetterWrongCaveatsCheckedCoverage
FactualA0019assessed: A · 0 wrong of 19 checked · 0 caveats
ApplicableA0011assessed: A · 0 wrong of 11 checked · 0 caveats
ConsistentA0019assessed: A · 0 wrong of 19 checked · 0 caveats
Transparent—001assessed: 0 wrong · 0 caveats · 1 checked
SafeA0010assessed: A · 0 wrong of 10 checked · 0 caveats
Topics · 11 topics

Topics

TopicFactualApplicableConsistentTransparentSafe
Introduction0 issues 1 checked F100 issues 1 checked0 issues 1 checked
Install0 issues 2 checked F4 F110 issues 1 checked0 issues 2 checked
Queues and consumers0 issues 1 checked F120 issues 1 checked0 issues 1 checked
Sending0 issues 1 checked F70 issues 1 checked
Forcing ticks and snapshots0 issues 3 checked F3 F8 F130 issues 1 checked0 issues 3 checked
Acknowledgment0 issues 1 checked F10 issues 1 checked0 issues 1 checked
Retries0 issues 1 checked F20 issues 1 checked0 issues 1 checked
Dead-letter queue0 issues 2 checked F14 F150 issues 2 checked0 issues 2 checked
Queue and consumer health0 issues 2 checked F5 F190 issues 2 checked
Status0 issues 2 checked F16 F200 issues 1 checked0 issues 2 checked
Production and teardown0 issues 3 checked F6 F17 F180 issues 2 checked0 issues 3 checked0 issues 1 checked

Issues found among the claims checked, per topic and axis. Each link goes to the finding behind the count.

Revisions: 5 · C -> A- -> D+ -> A- -> A

We audited this article 5 times. Each row is the final edition of one audit. Letters and findings of earlier revisions stay readable at their own address.

  1. Revision 1 · 2026-10-14 00:00 UTC · C · audit version not recorded · regrade version not recorded

    Article as first submitted. 8 accurate · 4 wrong · 1 caveat.

    ElephantSeal: C.

    Changes: First audit. Open: F1 “pending_events is the count waiting for the next tick.” (false); F2 “…median latency of roughly 50 ms at the default 100 ms tick.” (misleading); F8 “The ticker health target omits 1-minute idle backoff” (misleading); F9 “The 50 ms latency claim omits queue tick thresholds” (misleading); F10 “…orders | 00:00:03.412 | 0 | 7…” (mostly accurate).

  2. Revision 2 · 2026-10-14 04:35 UTC · A- · audit version not recorded · regrade version not recorded

    Article text changed. 17 accurate · 0 wrong · 0 caveats.

    ElephantSeal: A-. Open: the production risk is not yet fixed or warned about.

    Changes: No longer reported: “pending_events is the count waiting for the next tick.”; “…median latency of roughly 50 ms at the default 100 ms tick.”; “The ticker health target omits 1-minute idle backoff”; “The 50 ms latency claim omits queue tick thresholds”; “…orders | 00:00:03.412 | 0 | 7…”. New: none.

  3. Revision 3 · 2026-10-19 08:34 UTC · D+ · audited with v1.0.14 (approx.)

    Same article text, re-audited. 23 accurate · 1 wrong · 0 caveats.

    ElephantSeal: D+.

    Changes: No longer reported: none. New: F1 “Install prerequisites omit role-creation privileges” (misleading).

  4. Revision 4 · 2026-10-19 21:10 UTC · A- · audited with v1.0.16 (approx.)

    Same article text, re-audited. 14 accurate · 1 wrong · 0 caveats.

    ElephantSeal: A-. Open: the benchmark cannot yet be rerun from what is published.

    Changes: No longer reported: “Install prerequisites omit role-creation privileges”. New: F8 “Installation prerequisites omit role-creation privileges” (misleading).

  5. Revision 5 · this page · 2026-10-21 05:35 UTC · A · audited with v1.0.17 (approx.) · regraded with v1.1.0 (approx.)

    Same article text, re-audited. 19 accurate · 0 wrong · 0 caveats.

    ElephantSeal: A.

    Changes: No longer reported: “Installation prerequisites omit role-creation privileges”. New: none.

Questions and answers

Questions and answers

What is pgTrue?

pgTrue is an independent fact-check of technical Postgres articles, made by PostgresAI. It helps you check advice before you use it.

What does the letter grade mean?

The letter grade summarizes the claims we checked. Five axes show what we checked:

  • Factual: is it true?
  • Applicable: does it apply to my setup, today?
  • Consistent: does it agree with itself?
  • Transparent: can I check it myself?
  • Safe: can I run this in production?

What is the ElephantSeal?

The ElephantSeal is the mark an article earns. It always shows the latest edition. “Open:” lists what is still open.

Can an author reply?

Authors can ask us to correct a finding, reply to it, or withdraw it. Right-of-reply policy.

Paste into your AI assistant to fix the article, then ask for a re-review.

Show the text
Fix the article with this report, then ask pgTrue for a re-review.

# pgTrue report: Tutorial

Article title: Tutorial
Article URL: https://pgque.dev/docs/tutorial
Report URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326
Audited revision: 5 of 5, 2026-10-21 05:35:11 UTC
Overall letter: A

## Axes

- Factual: A · 0 wrong · 19 checked · 0 caveats · assessed
- Applicable: A · 0 wrong · 11 checked · 0 caveats · assessed
- Consistent: A · 0 wrong · 19 checked · 0 caveats · assessed
- Transparent: — · 0 wrong · 1 checked · 0 caveats · assessed
- Safe: A · 0 wrong · 10 checked · 0 caveats · assessed

ElephantSeal: A.

## Report metadata

- Report: Technical fact-check, edition 3
- Issued: 2026-10-21
- Edition: Updated after review. Corrections are listed below.
- Submitted: Submitted by the PostgresAI team.
- Author response: No written reply from the author. The article changed 1 time after our first audit; we re-audited each version. See Revisions below. Policy: [right-of-reply and corrections policy](/pgtrue/security).
- pgTrue version: audited with v1.0.17 (approx.) · regraded with v1.1.0 (approx.)

## Findings needing a change (0)

None.

## Verified accurate claims (19)

### F1 · Accurate · Factual · receive rejects oversized batches rather than paginating
Location: excerpt · section “Step 6: Ack the batch” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=max_return%20is%20a%20complete%2Dbatch%20safety%20ceiling%2C%20not%20pagination)
Article says:
```text
max_return is a complete-batch safety ceiling, not pagination…
```
What is true:
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.
Charitable reading:
The tutorial distinguishes capturing one batch identifier from processing every message in that batch.
Review: We checked for an off-by-one error and pagination behavior. receive raises on the next event after reaching max_return. finish_batch advances the entire cursor. We tested whether max_return truncates a batch. The overflow branch raises 54000, and acknowledgment advances the whole cursor.

Sources:
- [[email protected] · sql/pgque.sql:5366-5370](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5366-L5370)
  Excerpt:
  ```text
  if cnt = i_max_return then
            raise exception 'pgque.receive: batch exceeds max_return of %', i_max_return
                using
                    errcode = '54000',
                    hint = 'Retry with a larger resource-safe max_return to receive the complete batch. Do not acknowledge after this error.';
  ```
- [[email protected] · sql/pgque.sql:5921-5929](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5921-L5929)
  Excerpt:
  ```text
  update pgque.subscription
        set
            sub_active = now(),
            sub_last_tick = sub_next_tick,
            sub_next_tick = null,
            sub_batch = null
        where
            sub_queue = v_sub.sub_queue
            and sub_consumer = v_sub.sub_consumer;
  ```
- [[email protected] · sql/pgque.sql:5326-5337](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5326-L5337)
  Excerpt:
  ```text
  create type pgque.message as (
            msg_id      bigint,
            batch_id    bigint,
            type        text,
            payload     text,
            retry_count int4,
            created_at  timestamptz,
            extra1      text,
            extra2      text,
            extra3      text,
            extra4      text
        );
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F1

### F2 · Accurate · Factual · The retry ceiling and third-nack example match the code
Location: excerpt · section “Step 8: Drive the bad order into the dead-letter queue” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=coalesce%28ev_retry%2C%200%29%20%3E%3D%20max_retries)
Article says:
```text
…coalesce(ev_retry, 0) >= max_retries…
```
What is true:
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.
Charitable reading:
The ceiling counts redeliveries. It does not count the initial delivery as retry 1.
Review: We tested whether the initial delivery counts as retry 1. The comparison uses zero initially, and retry insertion increments it. The third nack reaches 2. We checked for an off-by-one error. The stored count increments on retry, so a ceiling of 2 routes the third nack.

Sources:
- [[email protected] · sql/pgque.sql:5418-5421](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5418-L5421)
  Excerpt:
  ```text
  select coalesce(q.queue_max_retries, 5) into v_max_retries
    from pgque.subscription s
    join pgque.queue q on q.queue_id = s.sub_queue
    where s.sub_batch = i_batch_id;
  ```
- [[email protected] · sql/pgque.sql:5440-5449](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5440-L5449)
  Excerpt:
  ```text
  if coalesce(v_ev.ev_retry, 0) >= v_max_retries then
        -- Move to dead letter queue using canonical event data (#98).
        -- event_dead() uses ON CONFLICT DO NOTHING for idempotency (#104).
        -- ev_txid is bigint in get_batch_events (legacy PgQ signature); text
        -- round-trip is the codebase convention to widen to xid8 without loss.
        perform pgque.event_dead(i_batch_id, v_ev.ev_id,
            coalesce(i_reason, 'max retries exceeded'),
            v_ev.ev_time, v_ev.ev_txid::text::xid8, v_ev.ev_retry,
            v_ev.ev_type, v_ev.ev_data,
            v_ev.ev_extra1, v_ev.ev_extra2, v_ev.ev_extra3, v_ev.ev_extra4);
  ```
- [[email protected] · sql/pgque.sql:2371-2376](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2371-L2376)
  Excerpt:
  ```text
  insert into pgque.retry_queue (ev_retry_after, ev_queue,
        ev_id, ev_time, ev_txid, ev_owner, ev_retry, ev_type, ev_data,
        ev_extra1, ev_extra2, ev_extra3, ev_extra4)
    select x_retry_time, sub_queue,
           ev_id, ev_time, NULL, sub_id, coalesce(ev_retry, 0) + 1,
           ev_type, ev_data, ev_extra1, ev_extra2, ev_extra3, ev_extra4
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F2

### F3 · Accurate · Factual · Verified accurate: “PgQue marks batch boundaries with a pg_snapshot…”
Location: excerpt · section “Step 5: Force the next tick, then receive” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=PgQue%20marks%20batch%20boundaries%20with%20a%20pg_snapshot)
Article says:
```text
PgQue marks batch boundaries with a pg_snapshot…
```
What is true:
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.
Review: The snapshot mechanism survives. E-18 quotes only active-snapshot retrieval and its error branch. That excerpt does not establish the claimed PostgreSQL 14.0 snapshot API. We removed the broader compatibility assertion.

Sources:
- [[email protected] · sql/pgque.sql:140-140](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L140-L140)
  Excerpt:
  ```text
  tick_snapshot               pg_snapshot   not null default pg_current_snapshot(),
  ```
- [[email protected] · sql/pgque.sql:420-421](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L420-L421)
  Excerpt:
  ```text
  || ' and pg_visible_in_snapshot(ev.ev_txid, cur.tick_snapshot)'
            || ' and not pg_visible_in_snapshot(ev.ev_txid, last.tick_snapshot)'
  ```
- [REL_14_0 · src/backend/utils/adt/xid8funcs.c:402-404](https://github.com/postgres/postgres/blob/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/src/backend/utils/adt/xid8funcs.c#L402-L404)
  Qualification: Version note: PostgreSQL 14.0 version floor.
  Excerpt:
  ```text
  cur = GetActiveSnapshot();
	if (cur == NULL)
		elog(ERROR, "no active snapshot set");
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F3

### F4 · Accurate · Factual · Reader and writer roles have separate memberships
Location: excerpt · section “Step 1: Install” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=The%20roles%20are%20siblings%2C%20not%20parent%20and%20child)
Article says:
```text
The roles are siblings, not parent and child…
```
What is true:
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.
Charitable reading:
The sibling description concerns reader and writer. The article separately describes admin inheriting both.
Review: We tested whether admin membership contradicts the sibling description. The article separately explains admin inheritance. The installer separates writer from reader and grants both to admin. We tested the sibling description against admin membership. The surrounding text distinguishes admin, and the installer grants admin both roles.

Sources:
- [[email protected] · sql/pgque.sql:4735-4748](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4735-L4748)
  Excerpt:
  ```text
  if pg_has_role('pgque_writer', 'pgque_reader', 'member') then
        revoke pgque_reader from pgque_writer;
    end if;
end $$;

-- Grant role hierarchy idempotently. Use explicit membership checks instead
-- of GRANT IF NOT EXISTS so this stays compatible with PG14/15.
do $$
begin
    if not pg_has_role('pgque_admin', 'pgque_reader', 'member') then
        grant pgque_reader to pgque_admin;
    end if;
    if not pg_has_role('pgque_admin', 'pgque_writer', 'member') then
        grant pgque_writer to pgque_admin;
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F4

### F5 · Accurate · Factual · Verified accurate: “pending_events estimates the ticked backlog after the consumer’s finished position…”
Location: excerpt · section “Step 9: Check queue and consumer health” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=pending_events%20estimates%20the%20ticked%20backlog%20after%20the%20consumer%E2%80%99s%20finished%20position)
Article says:
```text
pending_events estimates the ticked backlog after the consumer’s finished position…
```
What is true:
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).
Review: We checked which sequence values the subtraction uses. E-20 through E-22 support backlog and lag calculations. They do not show forced sequence advances. We removed that additional explanation from this finding.

Sources:
- [[email protected] · sql/pgque.sql:2761-2770](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2761-L2770)
  Excerpt:
  ```text
  select q.queue_name, c.co_name,
               current_timestamp - t.tick_time,
               current_timestamp - s.sub_active,
               s.sub_last_tick, s.sub_batch, s.sub_next_tick,
               t.tick_event_seq, q.queue_id
          from pgque.queue q,
               pgque.consumer c,
               pgque.subscription s
               left join pgque.tick t
                 on (t.tick_queue = s.sub_queue and t.tick_id = s.sub_last_tick)
  ```
- [[email protected] · sql/pgque.sql:2777-2782](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2777-L2782)
  Excerpt:
  ```text
  select t.tick_event_seq - _pending_events
            into pending_events
            from pgque.tick t
            where t.tick_queue = _queue_id
            order by t.tick_queue desc, t.tick_id desc
            limit 1;
  ```
- [[email protected] · sql/pgque.sql:2646-2647](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2646-L2647)
  Excerpt:
  ```text
  ev_new = pgque.seq_getval(_queue_event_seq) - _top_tick_event_seq;
        last_tick_id = _top_tick_id;
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F5

### F6 · Accurate · Factual · The default scheduler cadence is distinct from queue tick thresholds
Location: excerpt · section “Where to go from here” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=Queue%20thresholds%20still%20default%20to,seconds%20since%20the%20last%20tick)
Article says:
```text
Queue thresholds still default to 500 events or 3 seconds since the last tick…
```
What is true:
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.
Charitable reading:
The 3-second threshold concerns active queues. The article separately explains idle backoff and scheduler delay.
Review: We checked whether 100 milliseconds guarantees a tick and whether idle behavior contradicts the finding. Queue thresholds govern creation. The article explicitly distinguishes idle backoff. We tested whether 100 milliseconds guarantees delivery. The loop checks the ticker, while separate queue settings define tick thresholds.

Sources:
- [[email protected] · sql/pgque.sql:110-112](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L110-L112)
  Excerpt:
  ```text
  queue_ticker_max_count      integer     not null default 500,
        queue_ticker_max_lag        interval    not null default '3 seconds',
        queue_ticker_idle_period    interval    not null default '1 minute',
  ```
- [[email protected] · sql/pgque.sql:4187-4202](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4187-L4202)
  Excerpt:
  ```text
  v_iter_budget := greatest(1, v_window_ms / v_period_ms);

    for i in 1 .. v_iter_budget loop
        perform pgque.ticker();
        commit;

        if i = v_iter_budget then
            exit;
        end if;

        v_elapsed_ms := extract(epoch from (clock_timestamp() - v_started_at)) * 1000.0;
        if v_elapsed_ms + v_period_ms >= v_window_ms then
            exit;
        end if;

        perform pg_sleep(v_period_ms / 1000.0);
  ```
- [[email protected] · sql/pgque.sql:3958-3958](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L3958-L3958)
  Excerpt:
  ```text
  tick_period_ms  integer not null default 100
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F6

### F7 · Accurate · Factual · Untyped payload literals select the text overload
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=without%20the%20%3A%3Ajsonb%20cast%20resolves%20to%20the%20text%20overload)
Article says:
```text
…without the ::jsonb cast resolves to the text overload…
```
What is true:
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.
Charitable reading:
The article distinguishes an unknown SQL literal from an explicit jsonb cast.
Review: We checked overload ambiguity and key ordering. PostgreSQL prefers the string category for unknown literals. The comparator orders equal-length keys by bytes, as the finding states. We checked whether JSON-looking text selects jsonb automatically. Unknown literals prefer the string category, and the text overload passes payloads unchanged.

Sources:
- [[email protected] · sql/pgque.sql:6795-6799](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L6795-L6799)
  Excerpt:
  ```text
  create or replace function pgque.send(queue_name text, payload jsonb)
returns bigint as $$
begin
    return pgque.insert_event(queue_name, 'default', payload::text);
end;
  ```
- [[email protected] · sql/pgque.sql:6809-6813](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L6809-L6813)
  Excerpt:
  ```text
  create or replace function pgque.send(queue_name text, payload text)
returns bigint as $$
begin
    return pgque.insert_event(queue_name, 'default', payload);
end;
  ```
- [REL_14_24 · doc/src/sgml/typeconv.sgml:726-731](https://github.com/postgres/postgres/blob/6b3806732b7c5df06bdd0ed150e8a07b4ad62315/doc/src/sgml/typeconv.sgml#L726-L731)
  Excerpt:
  ```text
  If any input arguments are <type>unknown</type>, check the type categories
accepted
at those argument positions by the remaining candidates.  At each position,
select the <type>string</type> category if any candidate accepts that category.
(This bias towards string
is appropriate since an unknown-type literal looks like a string.)
  ```
- [REL_14_24 · src/backend/utils/adt/jsonb_util.c:1900-1906](https://github.com/postgres/postgres/blob/6b3806732b7c5df06bdd0ed150e8a07b4ad62315/src/backend/utils/adt/jsonb_util.c#L1900-L1906)
  Excerpt:
  ```text
  lengthCompareJsonbString(const char *val1, int len1, const char *val2, int len2)
{
	if (len1 == len2)
		return memcmp(val1, val2, len1);
	else
		return len1 > len2 ? 1 : -1;
}
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F7

### F8 · Accurate · Factual · force_next_tick advances the sequence without inserting a tick
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=each%20pgque.force_next_tick%20call%20advances%20the,sequence%20by%20a%20large%20amount)
Article says:
```text
…each pgque.force_next_tick call advances the event sequence by a large amount…
```
What is true:
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.
Charitable reading:
The numeric examples are illustrative. The article warns that forced ticks change sequence-derived values.
Review: We inspected force_tick for a hidden tick insertion. It advances the event sequence. The separate ticker function inserts the boundary. We checked whether forcing inserts a tick directly. It advances the event sequence, while ticker performs the boundary insertion.

Sources:
- [[email protected] · sql/pgque.sql:5223-5226](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5223-L5226)
  Excerpt:
  ```text
  -- Bump event-seq past ticker_max_count so the next pgque.ticker() run ticks.
    perform setval(queue_event_seq, nextval(queue_event_seq) + v_max_count * 2 + 1000)
       from pgque.queue
      where queue_id = v_queue_id;
  ```
- [[email protected] · sql/pgque.sql:788-789](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L788-L789)
  Excerpt:
  ```text
  insert into pgque.tick (tick_queue, tick_id, tick_event_seq)
        values (q.queue_id, nextval(q.queue_tick_seq), q.event_seq);
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F8

### F10 · Accurate · Factual · PostgreSQL 14 is a supported release target
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=Prerequisites%3A%20Postgres%2014%20or%20newer)
Article says:
```text
Prerequisites: Postgres 14 or newer…
```
What is true:
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.
Charitable reading:
The prerequisite names a supported floor. It does not claim these PostgreSQL APIs first appeared in version 14.
Review: We checked whether PostgreSQL 14 support rests only on a later patch release. The 14.0 catalog contains the API. PgQue v0.2.2 explicitly includes 14 in its test matrix. We checked whether support for PostgreSQL 14 was inferred from newer APIs. The release explicitly tests 14, whose catalog contains pg_current_snapshot.

Sources:
- [[email protected] · .github/workflows/ci.yml:16-16](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/.github/workflows/ci.yml#L16-L16)
  Excerpt:
  ```text
  pg_version: ['18', '17', '16', '15', '14']
  ```
- [REL_14_0 · src/include/catalog/pg_proc.dat:9885-9885](https://github.com/postgres/postgres/blob/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/src/include/catalog/pg_proc.dat#L9885-L9885)
  Qualification: Version note: Checked the article's PostgreSQL 14 floor.
  Excerpt:
  ```text
  proname => 'pg_current_snapshot', provolatile => 's',
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F10

### F11 · Accurate · Factual · The installer creates the named schema and roles
Location: excerpt · section “Step 1: Install” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=three%20roles%20%28%20pgque_reader%20%2C%20pgque_writer%20%2C%20pgque_admin%20%29)
Article says:
```text
…three roles ( pgque_reader , pgque_writer , pgque_admin )…
```
What is true:
PgQue v0.2.2 creates the pgque schema at sql/pgque.sql:10. Lines 4706–4714 create pgque_reader, pgque_writer, and pgque_admin when absent.
Charitable reading:
The installer creates missing roles and preserves existing roles.
Review: We checked existing-role behavior against the creation claim. The finding preserves the qualification that roles are created when absent. All three names and the schema match. We checked existing-role behavior. Conditional creation preserves existing roles and creates each missing role, as the finding states.

Sources:
- [[email protected] · sql/pgque.sql:4706-4714](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4706-L4714)
  Excerpt:
  ```text
  if not exists (select from pg_roles where rolname = 'pgque_reader') then
        create role pgque_reader;
    end if;
    if not exists (select from pg_roles where rolname = 'pgque_writer') then
        create role pgque_writer;
    end if;
    if not exists (select from pg_roles where rolname = 'pgque_admin') then
        create role pgque_admin;
    end if;
  ```
- [[email protected] · sql/pgque.sql:10-10](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L10-L10)
  Excerpt:
  ```text
  create schema if not exists pgque;
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F11

### F12 · Accurate · Factual · Queue creation returns the documented status
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=create_queue%20returns%201%20when%20it,0%20if%20it%20already%20existed)
Article says:
```text
…create_queue returns 1 when it created the queue, 0 if it already existed…
```
What is true:
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.
Charitable reading:
Idempotence describes repeating creation for an existing queue. It does not promise concurrent creation cannot race.
Review: We checked both return branches and considered concurrent creation. The finding asserts sequential status behavior, not race-free creation. Existing queues return 0, and successful creation returns 1. We tested the idempotence wording against concurrent creation. The finding limits its conclusion to documented return branches and makes no concurrency guarantee.

Sources:
- [[email protected] · sql/pgque.sql:1467-1470](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L1467-L1470)
  Excerpt:
  ```text
  perform 1 from pgque.queue where queue_name = i_queue_name;
    if found then
        return 0;
    end if;
  ```
- [[email protected] · sql/pgque.sql:1503-1509](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L1503-L1509)
  Excerpt:
  ```text
  perform pgque.grant_perms(i_queue_name);

    perform pgque.ticker(i_queue_name);

    perform pgque.tune_storage(i_queue_name);

    return 1;
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F12

### F13 · Accurate · Factual · Forcing the next tick advances the sequence and returns the previous tick
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=force_next_tick%20returns%20the%20current%20last%20tick%20id)
Article says:
```text
…force_next_tick returns the current last tick id…
```
What is true:
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.
Charitable reading:
The guarantee applies to the tutorial's new, unpaused queue using its internal ticker.
Review: We checked whether forcing returns a newly created tick. It selects the latest existing tick after advancing the sequence. ticker counts only queues that produce a tick. We checked whether forcing returns a newly created tick. It selects the latest existing tick, and ticker counts successful queue ticks.

Sources:
- [[email protected] · sql/pgque.sql:5224-5237](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5224-L5237)
  Excerpt:
  ```text
  perform setval(queue_event_seq, nextval(queue_event_seq) + v_max_count * 2 + 1000)
       from pgque.queue
      where queue_id = v_queue_id;

    -- Return the current last tick id (the one before force_tick took effect).
    -- If the queue has no ticks yet, returns NULL — same as the upstream
    -- behavior on a brand-new queue.
    select tick_id
      into v_max_tick
      from pgque.tick
     where tick_queue = v_queue_id
     order by tick_id desc
     limit 1;
    return v_max_tick;
  ```
- [[email protected] · sql/pgque.sql:818-822](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L818-L822)
  Excerpt:
  ```text
  if pgque.ticker(q.queue_name) > 0 then
            res := res + 1;
        end if;
    end loop;
    return res;
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F13

### F14 · Accurate · Factual · A retry ceiling of 2 routes the third failure to dead letters
Location: excerpt · section “Step 8: Drive the bad order into the dead-letter queue” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=Third%20nack%3A%20retry_count%20%3D%202,2%20%3E%3D%202%20is%20true)
Article says:
```text
Third nack: retry_count = 2 . 2 >= 2 is true…
```
What is true:
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.
Charitable reading:
The count represents completed retries. The initial delivery has a null count.
Review: We recalculated the three comparisons using counts 0, 1, and 2. Only the third reaches the ceiling. The standalone API and combined installer agree. We recomputed the three failures from counts 0, 1, and 2. Only the third count satisfies the terminal comparison.

Sources:
- [[email protected] · sql/pgque.sql:5440-5440](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5440-L5440)
  Excerpt:
  ```text
  if coalesce(v_ev.ev_retry, 0) >= v_max_retries then
  ```
- [[email protected] · sql/pgque.sql:2375-2375](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2375-L2375)
  Excerpt:
  ```text
  ev_id, ev_time, NULL, sub_id, coalesce(ev_retry, 0) + 1,
  ```
- [[email protected] · sql/pgque-api/receive.sql:127-127](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque-api/receive.sql#L127-L127)
  Excerpt:
  ```text
  if coalesce(v_ev.ev_retry, 0) >= v_max_retries then
  ```
- [[email protected] · sql/pgque.sql:2375-2375](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2375-L2375)
  Excerpt:
  ```text
  ev_id, ev_time, NULL, sub_id, coalesce(ev_retry, 0) + 1,
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F14

### F15 · Accurate · Factual · Dead-letter replay inserts an event and removes the dead-letter row
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=it%20re%2Denters%20with%20a%20fresh%20event%20id)
Article says:
```text
…it re-enters with a fresh event id…
```
What is true:
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.
Charitable reading:
Replay creates a new queue event rather than restoring the original event ID.
Review: We checked whether replay restores the original ID or retains the dead-letter row. Replay calls insert_event without that ID, deletes the dead-letter row, and returns the insertion result. We checked whether replay preserves the original identifier or leaves the dead-letter row. It inserts an event and deletes that row.

Sources:
- [[email protected] · sql/pgque.sql:4999-5005](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4999-L5005)
  Excerpt:
  ```text
  v_new_eid := pgque.insert_event(v_dl.queue_name, v_dl.ev_type, v_dl.ev_data,
        v_dl.ev_extra1, v_dl.ev_extra2, v_dl.ev_extra3, v_dl.ev_extra4);

    -- Remove from DLQ
    delete from pgque.dead_letter where dl_id = i_dead_letter_id;

    return v_new_eid;
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F15

### F16 · Accurate · Factual · Scheduler status reflects configuration as described
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=with%20no%20scheduler%2C%20the%20scheduler%20row%20reads%20manual)
Article says:
```text
…with no scheduler, the scheduler row reads manual…
```
What is true:
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.
Charitable reading:
The article describes configured scheduler state. It does not treat scheduled as proof of successful execution.
Review: We checked whether the finding confuses configured scheduling with successful execution. It describes configuration only. The manual fallback, pg_cron assignment, and 30-second retry schedule match. We tested whether configured scheduling was confused with successful execution. The finding describes configuration and correctly identifies the 30-second retry schedule.

Sources:
- [[email protected] · sql/pgque.sql:4592-4598](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4592-L4598)
  Excerpt:
  ```text
  select 'scheduler'::text,
        coalesce(c.scheduler, 'manual')::text,
        format('ticker_job_id=%s, maint_job_id=%s, tick_period_ms=%s (%s ticks/sec)',
            coalesce(c.ticker_job_id::text, 'NULL'),
            coalesce(c.maint_job_id::text, 'NULL'),
            c.tick_period_ms,
            (1000.0 / c.tick_period_ms)::numeric(10, 2))
  ```
- [[email protected] · sql/pgque.sql:4305-4308](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4305-L4308)
  Excerpt:
  ```text
  update pgque.config
    set ticker_job_id = v_ticker_id,
        maint_job_id = v_maint_id,
        scheduler = 'pg_cron';
  ```
- [[email protected] · sql/pgque.sql:4279-4284](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4279-L4284)
  Excerpt:
  ```text
  select cron.schedule_in_database(
        'pgque_retry_events',
        '30 seconds',
        $sql$set statement_timeout = '25s'; select pgque.maint_retry_events()$sql$,
        v_dbname
    ) into v_retry_id;
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F16

### F17 · Accurate · Factual · Uninstall preserves the three cluster roles
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=To%20remove%20PgQue%20entirely%20%28drops,pgque%20schema%3B%20leaves%20the%20roles%29)
Article says:
```text
…To remove PgQue entirely (drops the pgque schema; leaves the roles)…
```
What is true:
PgQue v0.2.2 drops the schema with CASCADE at sql/pgque.sql:4564. uninstall() leaves pgque_reader, pgque_writer, and pgque_admin.
Charitable reading:
Complete removal refers to database objects. The article explicitly excludes cluster roles.
Review: We checked whether CASCADE also removes cluster roles. The uninstall statement drops the schema. Its adjacent comment explicitly preserves roles. We checked whether schema removal also removes cluster roles. The uninstall code drops the schema and explicitly preserves roles.

Sources:
- [[email protected] · sql/pgque.sql:4564-4565](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L4564-L4565)
  Excerpt:
  ```text
  drop schema pgque cascade;
    -- Note: roles are not dropped here (they may be in use by other databases)
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F17

### F18 · Accurate · Factual · The historical latency qualification matches the benchmark records
Location: excerpt · section “Where to go from here” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=The%20historical%20roughly%2052%20ms,consumer%2C%20not%20default%20queue%20settings)
Article says:
```text
The historical roughly 52 ms median used lowered thresholds and a fast-polling consumer, not default queue settings…
```
What is true:
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.
Charitable reading:
The article labels 52 ms as historical tuned performance. It does not promise that latency with default thresholds.
Review: We checked whether the finding presents recorded latency as independently measured performance. It explicitly describes recorded results. The benchmark configuration lowers thresholds, and the documentation identifies fast polling. We checked whether the finding presents 52.6 milliseconds as independently measured or default performance. It identifies recorded results and lowered thresholds.

Sources:
- [[email protected] · benchmark/tick-rate/results-baseline.json:10-10](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/benchmark/tick-rate/results-baseline.json#L10-L10)
  Qualification: Version note: Recorded benchmark output, independently unmeasured.
  Excerpt:
  ```text
  "p50_ms": 52.60300636291504,
  ```
- [[email protected] · benchmark/tick-rate/bench.py:66-68](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/benchmark/tick-rate/bench.py#L66-L68)
  Excerpt:
  ```text
  cur.execute("select pgque.set_queue_config(%s, 'ticker_max_lag', '0 seconds')", (queue,))
        cur.execute("select pgque.set_queue_config(%s, 'ticker_idle_period', '0 seconds')", (queue,))
        cur.execute("select pgque.set_queue_config(%s, 'ticker_max_count', '1')", (queue,))
  ```
- [https://pgque.dev/docs/latency-and-tuning](https://pgque.dev/docs/latency-and-tuning)
  Excerpt:
  ```text
  The historical benchmark used tick_period_ms = 100 , lowered queue thresholds,
and a fast-polling consumer.
  ```
- [[email protected] · benchmark/tick-rate/README.md:53-53](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/benchmark/tick-rate/README.md#L53-L53)
  Excerpt:
  ```text
  |  100 |   100 |  3000 |  3000 |  52.62 |  98.86 | 103.48 |  105.28 |  52.74 |
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F18

### F19 · Accurate · Factual · The consumer-lag comparison respects the stated condition
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=its%20lag%20is%20therefore%20at%20least%20the%20earlier%20queue%2Dlag%20reading)
Article says:
```text
…its lag is therefore at least the earlier queue-lag reading…
```
What is true:
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.
Charitable reading:
The comparison assumes no intervening tick and follows the displayed queries in order.
Review: We applied the stated no-intervening-tick condition and checked query order. Consumer lag uses its finished tick. The displayed 3.510 seconds exceeds the earlier 3.412-second queue reading. We checked the inequality under its no-intervening-tick condition. Both functions use tick timestamps, and 3.510 seconds exceeds 3.412 seconds.

Sources:
- [[email protected] · sql/pgque.sql:2761-2770](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2761-L2770)
  Excerpt:
  ```text
  current_timestamp - t.tick_time,
  ```
- [[email protected] · sql/pgque.sql:2626-2632](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L2626-L2632)
  Excerpt:
  ```text
  select (current_timestamp - t.tick_time),
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F19

### F20 · Accurate · Factual · The configured rate conversion is correct
Location: Article · exact quote · [open in article](https://pgque.dev/docs/tutorial#:~:text=tick_period_ms%3D100%20%2810.00%20ticks%2Fsec%29)
Article says:
```text
…tick_period_ms=100 (10.00 ticks/sec)…
```
What is true:
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.
Charitable reading:
The article explicitly distinguishes the configured rate from measured tick creation.
Review: We recalculated 1,000 milliseconds divided by 100 milliseconds and checked the status expression. Both yield 10 checks per second. The article disclaims measured tick throughput. We recomputed 1,000 milliseconds divided by 100 milliseconds. The result is 10 checks per second, matching the status calculation.

Sources:
- [[email protected] · sql/pgque-additions/lifecycle.sql:466-466](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque-additions/lifecycle.sql#L466-L466)
  Excerpt:
  ```text
  (1000.0 / c.tick_period_ms)::numeric(10, 2))
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F20

## Notes (not graded) (1)

### F9 · Note ·  · force_next_tick and ticker can share a transaction
Location: excerpt · section “Step 5: Force the next tick, then receive” · as fetched 2026-10-21 · [open in article](https://pgque.dev/docs/tutorial#:~:text=Each%20statement%20above%20runs%20in,This%20is%20required%2C%20not%20stylistic)
Article says:
```text
Each statement above runs in its own transaction. This is required, not stylistic…
```
What is true:
The requirement for a transaction per statement is too broad. force_tick changes the sequence at sql/pgque.sql:5223-5226. ticker reads that sequence and inserts a tick at lines 788-789. Those calls can share a transaction after send commits. The tutorial's separate statements remain safe.
So what:
Commit send before the ticker snapshot. Combine force_next_tick and ticker in one transaction when useful.
Charitable reading:
Autocommit is a safe tutorial convention. Keeping send and ticker separate protects the intended snapshot boundary.
Explanation: Not graded: no reader would act differently on it.
Review: We read the requirement as advice to commit send first. Its immediate scope also includes force_next_tick and ticker. Their sequence operations require no intervening commit. A note remains proportionate. We read the requirement as safe tutorial guidance. Its literal transaction requirement remains broader than necessary, and note severity preserves that distinction.

Sources:
- [[email protected] · sql/pgque.sql:140-140](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L140-L140)
  Excerpt:
  ```text
  tick_snapshot               pg_snapshot   not null default pg_current_snapshot(),
  ```
- [[email protected] · sql/pgque.sql:5223-5226](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L5223-L5226)
  Excerpt:
  ```text
  -- Bump event-seq past ticker_max_count so the next pgque.ticker() run ticks.
    perform setval(queue_event_seq, nextval(queue_event_seq) + v_max_count * 2 + 1000)
       from pgque.queue
      where queue_id = v_queue_id;
  ```
- [[email protected] · sql/pgque.sql:788-789](https://github.com/NikolayS/pgque/blob/dff3a906276068ad2433312bbc7c95a577deff53/sql/pgque.sql#L788-L789)
  Excerpt:
  ```text
  insert into pgque.tick (tick_queue, tick_id, tick_event_seq)
        values (q.queue_id, nextval(q.queue_tick_seq), q.event_seq);
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326#F9

## Withdrawn findings (0)

None.

## Section checks

- Introduction · A · 1 verified-accurate · 100% of claims (8 of 8, plus 1 that need data we do not have)
- Install · A · 2 verified-accurate · 87% of claims (14 of 16)
- Queues and consumers · A · 1 verified-accurate · 87% of claims (7 of 8)
- Sending · A · 1 verified-accurate · 60% of claims (3 of 5)
- Forcing ticks and snapshots · A · 3 verified-accurate · 87% of claims (14 of 16, plus 2 that need data we do not have)
- Acknowledgment · A · 1 verified-accurate · 95% of claims (19 of 20, plus 2 that need data we do not have)
- Retries · A · 1 verified-accurate · 95% of claims (20 of 21, plus 2 that need data we do not have)
- Dead-letter queue · A · 2 verified-accurate · 90% of claims (19 of 21, plus 2 that need data we do not have)
- Queue and consumer health · A · 2 verified-accurate · 72% of claims (18 of 25)
- Status · A · 2 verified-accurate · 100% of claims (10 of 10, plus 1 that need data we do not have)
- Production and teardown · A · 3 verified-accurate · 100% of claims (7 of 7)

## Claim coverage

- Introduction: 8 of 8 Postgres claims checked, plus 1 that need data we do not have; not counted: 2 product or opinion, 1 not a claim
- Install: 14 of 16 Postgres claims checked; not checked: 2 for other reasons
- Queues and consumers: 7 of 8 Postgres claims checked; not checked: 1 for other reasons
- Sending: 3 of 5 Postgres claims checked; not checked: 2 for other reasons
- Receiving before a tick: 9 of 9 Postgres claims checked
- Forcing ticks and snapshots: 14 of 16 Postgres claims checked, plus 2 that need data we do not have; not checked: 2 for other reasons
- Acknowledgment: 19 of 20 Postgres claims checked, plus 2 that need data we do not have; not checked: 1 for other reasons
- Retries: 20 of 21 Postgres claims checked, plus 2 that need data we do not have; not counted: 2 duplicate; not checked: 1 for other reasons
- Dead-letter queue: 19 of 21 Postgres claims checked, plus 2 that need data we do not have; not checked: 2 for other reasons
- Queue and consumer health: 18 of 25 Postgres claims checked; not counted: 1 not a claim; not checked: 7 for other reasons
- Status: 10 of 10 Postgres claims checked, plus 1 that need data we do not have; not counted: 1 product or opinion
- Production and teardown: 7 of 7 Postgres claims checked; not counted: 2 not a claim
- Further reading: 0 of 1 Postgres claims checked; not counted: 1 product or opinion, 5 not a claim; not checked: 1 for other reasons

## What we did not check

- We did not reproduce the displayed SQL outputs.
- We did not check how pg_timetable initializes its database schema.
- We did not reproduce the SQL sessions or latency measurements the article displays.
- We did not verify compatibility with every managed PostgreSQL service.
- We did not complete checks of producer concurrency, event-ID uniqueness, payload formats, or installation-owner privileges.
- We did not complete checks of replay visibility, purge boundaries, or the health-metric explanations.
- We did not establish the article's publication date or assess changes since publication.
- We could not retrieve the article's edit-page link.
- We did not reproduce the tutorial outputs or the historical latency measurements.
- Section “Further reading”: we checked 0 of 1 checkable claims.

## Notes

- A — the findings address the article's main subject. What we did not check is listed below. We checked PgQue v0.2.2 installation, snapshot delivery, acknowledgment, retries, dead-letter handling, and health calculations against source.
- We did not check everything in this article. What we did not check is listed below, in the words we recorded at the time. None of it moved the letter. We never charge our own limits to the article.
- Average of 4 axes: 4 · result A
- Some explanatory text is not shown in this edition; the grade and findings are complete.
- Some checks did not happen for this edition, and each one we know of is listed above.
- Checked against: github.com/postgres/postgres REL_14_24 at commit 6b3806732b7c5df06bdd0ed150e8a07b4ad62315 (pinned target); github.com/NikolayS/pgque v0.2.2 at commit dff3a906276068ad2433312bbc7c95a577deff53 (pinned target); github.com/citusdata/pg_cron v1.6.8 at commit 5cedfa472ccc83567aa23ec645925ed8489a7797 (pinned target); github.com/pgq/pgq v3.5.2 at commit be3d2cee3fc7279d9e1480b19cfddb8a62c1450d (pinned target); https://pgque.dev/docs (fetched 2026-10-21T05:35:31.190261Z); https://pgque.dev/docs/concepts (fetched 2026-10-21T05:35:24.995047Z); https://pgque.dev/docs/examples (fetched 2026-10-21T05:35:29.604637Z); https://pgque.dev/docs/installation (fetched 2026-10-21T05:35:25.913924Z); https://pgque.dev/docs/latency-and-tuning (fetched 2026-10-21T05:35:28.619717Z); https://pgque.dev/docs/monitoring (fetched 2026-10-21T05:35:27.764202Z); https://pgque.dev/docs/reference (fetched 2026-10-21T05:35:26.886720Z).
- Article captured 2026-10-21T05:35:11.197047Z · SHA-256 ff4219c01f3b6f0d05c077f39adf2e83fa4169d0663c4baccc8583df44a0c673 · Text extracted from the article's HTML.
- Policy SHA-256 016aa091ea51be8295ebda4b7d834960c92b08f7efde19f8cd4cd170f95db46d · Grading rules SHA-256 6fb334e79d6b9e7ed81d3238cc10d9de602ff87ed65ff2fa781f53bac5798765.
- The article states no author or publication date. We could not assess changes since publication.
- We did not reproduce the displayed SQL sessions or historical latency measurements.
- We did not verify compatibility with every managed PostgreSQL service.
- We did not check producer concurrency, event-ID uniqueness, non-JSON payload formats, or installation-owner privileges.
- We did not check replay visibility, purge boundaries, or how pg_timetable initializes its database schema.
- We could not retrieve the article's Edit page link.
- article target version: bound to the most-cited major; also named 17 (1×)
- source: pgque names no release in the article, so it was read at 0.2.2, the latest at fetch time
- source: pg_cron names no release in the article, so it was read at 1.6.8, the latest at fetch time
- source: pgq names no release in the article, so it was read at 3.5.2, the latest at fetch time
- review: the findings were written by one model and reviewed independently by a different model.
- 2026-10-27: Regraded under the current grading rules: the letter is the average of the axis letters, with every cap stated under it.
- 4 passages in this edition fell short of our own plain-English rules.
- Built from the article text captured above, 4 pinned source trees, and 7 fetched pages.
- 18 survived · 2 weakened · 0 withdrawn.

## Revision history

- [Revision 1](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326?v=2) · 2026-10-14 00:00 UTC · C · audit version not recorded · regrade version not recorded
  Article as first submitted. 8 accurate · 4 wrong · 1 caveat.
  ElephantSeal: C.
  Changes: First audit. Open: F1 “pending_events is the count waiting for the next tick.” (false); F2 “…median latency of roughly 50 ms at the default 100 ms tick.” (misleading); F8 “The ticker health target omits 1-minute idle backoff” (misleading); F9 “The 50 ms latency claim omits queue tick thresholds” (misleading); F10 “…orders \| 00:00:03.412 \| 0 \| 7…” (mostly accurate).
- [Revision 2](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326?v=6) · 2026-10-14 04:35 UTC · A- · audit version not recorded · regrade version not recorded
  Article text changed. 17 accurate · 0 wrong · 0 caveats.
  ElephantSeal: A-. Open: the production risk is not yet fixed or warned about.
  Changes: No longer reported: “pending_events is the count waiting for the next tick.”; “…median latency of roughly 50 ms at the default 100 ms tick.”; “The ticker health target omits 1-minute idle backoff”; “The 50 ms latency claim omits queue tick thresholds”; “…orders \| 00:00:03.412 \| 0 \| 7…”. New: none.
- [Revision 3](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326?v=9) · 2026-10-19 08:34 UTC · D+ · audited with v1.0.14 (approx.)
  Same article text, re-audited. 23 accurate · 1 wrong · 0 caveats.
  ElephantSeal: D+.
  Changes: No longer reported: none. New: F1 “Install prerequisites omit role-creation privileges” (misleading).
- [Revision 4](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326?v=11) · 2026-10-19 21:10 UTC · A- · audited with v1.0.16 (approx.)
  Same article text, re-audited. 14 accurate · 1 wrong · 0 caveats.
  ElephantSeal: A-. Open: the benchmark cannot yet be rerun from what is published.
  Changes: No longer reported: “Install prerequisites omit role-creation privileges”. New: F8 “Installation prerequisites omit role-creation privileges” (misleading).
- [Revision 5](https://pgtrue.postgres.ai/shared/brief/414d57ed-1e7d-499b-910f-2090217b0326?v=14) · this page · 2026-10-21 05:35 UTC · A · audited with v1.0.17 (approx.) · regraded with v1.1.0 (approx.)
  Same article text, re-audited. 19 accurate · 0 wrong · 0 caveats.
  ElephantSeal: A.
  Changes: No longer reported: “Installation prerequisites omit role-creation privileges”. New: none.

Updated your article? Request a correction. A new edition appears at this address.