The dead letter queue (DLQ) stores messages that have exhausted their retry budget. WhenDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/NikolayS/PgQue/llms.txt
Use this file to discover all available pages before exploring further.
nack() is called and retry_count >= max_retries, the event is routed to pgque.dead_letter instead of being re-queued. This reference covers the table schema and all DLQ management functions.
pgque.dead_letter table
| Column | Type | Nullable | Notes |
|---|---|---|---|
dl_id | bigserial | no | Primary key |
dl_queue_id | int4 | no | FK to pgque.queue, ON DELETE CASCADE |
dl_consumer_id | int4 | no | FK to pgque.consumer, ON DELETE CASCADE |
dl_time | timestamptz | no | When the message was dead-lettered (default now()) |
dl_reason | text | yes | Reason passed to nack() |
ev_id | bigint | no | Original event id |
ev_time | timestamptz | no | Original event creation time |
ev_txid | xid8 | yes | Transaction id of the original insert |
ev_retry | int4 | yes | Retry count when dead-lettered |
ev_type | text | yes | Event type |
ev_data | text | yes | Event payload |
ev_extra1 | text | yes | Extra column 1 |
ev_extra2 | text | yes | Extra column 2 |
ev_extra3 | text | yes | Extra column 3 |
ev_extra4 | text | yes | Extra column 4 |
pgque_reader has SELECT on this table. pgque_admin has full access.
dlq_inspect
queue, newest first. Grant: pgque_reader.
dlq_replay
pgque.dead_letter. Returns the new event id. Grant: pgque_writer.
ev_id and will be delivered on the next tick.
dlq_replay_all
queue. Per-event failures are isolated — one bad row does not abort the rest. Grant: pgque_writer.
first_error carries the first failure’s dl_id and sqlerrm for diagnostics. Failed entries are counted in failed and remain in the DLQ.
dlq_purge
older_than for queue. Returns the row count deleted. Grant: pgque_admin.
event_dead (internal)
pgque.dead_letter. Called internally by pgque.nack() when retries are exhausted — direct calls are rarely needed. Grant: pgque_admin.