pmq_maintenance_fast
SQL 0.1.1 · Source cbff27b8a34e1384384018680e46c20d5c610cc9.
Signature
postgremq.pmq_maintenance_fast()
RETURNS TABLE(retired_to_dlq bigint, inactive_queues_dropped bigint)
The signature, defaults, and result above were extracted from the installed PostgreSQL catalog.
Retire abandoned final attempts and reap expired queues
Moves expired processing deliveries at a finite attempt limit into the DLQ. A still-valid final claim is left alone. Then removes expired Exclusive queues without DLQ entries. Returns retired and dropped counts. Grouped retirement emits one queue wake-up per affected queue.
Transactions and errors
Transactional writes, not a bounded retention batch. Can wait on database locks. Does not schedule itself or collect completed history. Queue expiry is enforced before physical reaping; DLQ entries can preserve an expired queue.
All calls require the applicable caller privileges. See SQL errors for driver failures and uncertain outcomes.
Example
SELECT * FROM postgremq.pmq_maintenance_fast();
Zero counts can be healthy. Run regularly and record successful execution separately from rows changed.
Related: Maintenance, SQL conventions.