Contents
pg_listening_channels()
A function listing current notification channels
pg_listening_channels()
is a system function returning the synchronous notification channels that the current session is listening to.
pg_listening_channels()
was added in PostgreSQL 9.0.
Examples
Usage example for 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)
References
- PostgreSQL documentation: Session Information Functions