Open Listener Transactions Delay Notifications
@prranitarora▲ 11 net votes
A committed NOTIFY is not delivered to a listening client while that client is inside its own transaction. PostgreSQL queues it and delivers it just after the listener commits or rolls back. Long-running listener transactions therefore delay real-time notification handling even when senders have committed.
1 COMMENT
With libpq, call
PQconsumeInput()and thenPQnotifies()to read queued notifications. A client that never polls will not see them, even after the sender commits. If you have hit a variant of this, share it below.