问题描述
PostgreSQL具有良好的侦听/通知系统。 说:
PostgreSQL has a good listen/notify system. Documentation says:
但是我不知道发生了什么指定频道中没有监听器的事件。通知队列会溢出还是PG会从队列中删除这些事件?
But I can't find out what happening with events in a specified channel that doesn't have listeners. Will notification queue overflow or will PG drop these events from queue?
推荐答案
手册中可能更清楚,但是有明确表示一旦没有会话正在积极等待通知,队列就会被清除。
It could be more clear in the manual, but there is definitive indication that the queue is cleaned as soon as no session is actively waiting for the notification. Per documentation:
这意味着,如果没有人在听(没有活动的会话在同一通道上发出了 LISTEN
命令),则不会阻止Postgres立即清除队列 >。
That means, if nobody is listening (no active session has issued a LISTEN
command on the same channel), nothing keeps Postgres from cleaning the queue instantly.
这篇关于当没有会话在PostgreSQL中发布LISTEN时,使用NOTIFY会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!