Skip to main content

list_messages

SQL 0.1.1 · Source cbff27b8a34e1384384018680e46c20d5c610cc9.

Signature​

postgremq.list_messages(p_queue_name character varying)
RETURNS TABLE(message_id bigint, status character varying, published_at timestamp with time zone, delivery_attempts integer, vt timestamp with time zone, processed_at timestamp with time zone, group_key character varying, group_seq bigint)

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

Inspect one queue delivery history​

Returns message ID, status, delivery-row creation time (published_at), attempt count, VT, completion time, and group information, ordered by that delivery-row timestamp. DLQ requeue creates a new delivery row and resets this timestamp. Use get_message for the original message publication time. It excludes payload and ownership token. Completed rows remain until retention; dead letters are separate.

Transactions and errors​

Read-only. Missing queue returns no rows. Inspection does not grant settlement rights; claim through consume_message first.

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

Example​

SELECT * FROM postgremq.list_messages('reference-jobs');

The returned status is retained delivery state, not proof of active application processing.

Related: Topology, SQL conventions.