Skip to main content

list_dlq_messages

SQL 0.1.1 · Source cbff27b8a34e1384384018680e46c20d5c610cc9.

Signature​

postgremq.list_dlq_messages()
RETURNS TABLE(queue_name character varying, message_id bigint, retry_count integer, published_at timestamp with time zone)

The signature, defaults, and result above were extracted from the installed PostgreSQL catalog.

List dead-letter entries across queues​

Returns queue, message ID, retry count, and the timestamp the entry entered the DLQ, ordered by that timestamp. Its published_at is DLQ insertion time, not the original payload publication time. Use get_message for original metadata and payload.

Transactions and errors​

Read-only. Returns all queues; filter its result to investigate one queue. Listing does not remove entries or reserve a replay set against concurrent changes.

All calls require the applicable caller privileges. See SQL errors for driver failures and uncertain outcomes.

Example​

SELECT * FROM postgremq.list_dlq_messages()
WHERE queue_name = 'reference-jobs';

An empty result does not rule out exhausted final attempts awaiting maintenance.

Related: Dead letters, SQL conventions.