get_next_visible_time
SQL 0.1.1 · Source cbff27b8a34e1384384018680e46c20d5c610cc9.
Signature
postgremq.get_next_visible_time(p_queue_name character varying)
RETURNS timestamp with time zone
The signature, defaults, and result above were extracted from the installed PostgreSQL catalog.
Find the next candidate visibility time
Returns the earliest deadline among unsettled deliveries below the attempt limit and at their group head. Processing head lease deadlines are included. A past value means work may be eligible now; NULL means no candidate, including a missing queue. It does not check Exclusive expiry.
Transactions and errors
Read-only hint: it reserves nothing and can become stale immediately. No custom validation error is raised for a missing queue. Use consume_message to validate the subscription and obtain ownership.
All calls require the applicable caller privileges. See SQL errors for driver failures and uncertain outcomes.
Example
SELECT postgremq.get_next_visible_time('reference-jobs');
NULL is valid for a missing or empty queue. Bound polling even when the hint is NULL or already due.
Related: Notifications and polling, SQL conventions.