英文:
Listen to all notifications like `LISTEN *`
问题
是否可以监听由PostgreSQL广播的所有通知?例如,类似于LISTEN *
这样的方式,而不必创建任何临时通道,如all_channels
?我需要这样做来最小化正在监听通知的活动连接数量。想象一下,可能会有200个通道,这种方法实际上可以将捕获所有通知的活动连接数量最小化为仅为1。
英文:
Is it possible to listen to all notification that are broadcast by Postgress? For example something like LISTEN *
without having to create any ad-hoc channels like all_channels
? I need this to minimize the number of active connection that are listening to notifications. Imagine that there would be 200 channels, this approach can actually minimize the number of active connections to only 1 for capturing all notifications.
答案1
得分: 0
不,这是不可能的。尝试设计一个需要更少通道的方案,也许你可以通过通知的有效负载来区分:
通知通道,'4711';
英文:
No, that is not possible. Try to come up with a design that needs fewer channels – perhaps you can differentiate via the payload of the notification:
NOTIFY channel, '4711';
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论