pg_listening_channels() 是一个系统函数,用于返回当前会话正在监听的同步通知频道。
pg_listening_channels() 是在 PostgreSQL 9.0 中添加的。
示例
pg_listening_channels() 的使用示例
postgres=# LISTEN foo; LISTEN postgres=# LISTEN bar; LISTEN postgres=# SELECT * FROM pg_listening_channels(); pg_listening_channels ----------------------- foo bar (2 rows) postgres=# UNLISTEN bar; UNLISTEN postgres=# SELECT * FROM pg_listening_channels(); pg_listening_channels ----------------------- foo (1 row)
参考资料
- PostgreSQL 文档: 会话信息函数
