Asynchronous publish/subscribe messaging built into the database — no external message broker needed.
PostgreSQL publish/subscribe mechanism for asynchronous notifications between database sessions: LISTEN registers interest in a channel, NOTIFY sends a notification to all subscribers. Useful for cache invalidation, background job triggering, and event-driven architectures without polling.
Compatibility
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | Not Supported | - | Not supported. Use application-layer messaging (Redis pub/sub, etc.). |
| PostgreSQL | Native | all | LISTEN channel registers interest. NOTIFY channel [, payload] fires on transaction commit. Clients receive notifications via the connection. pg_notify(channel, payload) can be called from triggers or functions. Payload limited to ~8000 bytes. Works within a single database only. |
| SQL Server | Not Supported | - | Not supported as SQL. Service Broker provides similar functionality but with a very different architecture and syntax. |
| Oracle | Not Supported | - | Not supported as SQL. DBMS_ALERT and DBMS_PIPE PL/SQL packages provide async signaling but are PL/SQL-only. |
| SQLite | Not Supported | - | Not supported. SQLite is a single-process embedded database with no server process to hold pub/sub channels. |
Details
Unique to PostgreSQL. Commonly used for cache invalidation, real-time job queue signaling, and live-update feeds — without any external infrastructure. Fires on COMMIT, not on the NOTIFY call itself.
Standard Syntax
Version Support
Per-Database Syntax & Notes
MySQL Alternative syntax
Not supported. Use application-layer messaging (Redis pub/sub, etc.).
PostgreSQL Native syntax
LISTEN channel registers interest. NOTIFY channel [, payload] fires on transaction commit. Clients receive notifications via the connection. pg_notify(channel, payload) can be called from triggers or functions. Payload limited to ~8000 bytes. Works within a single database only.
SQL Server Alternative syntax
Not supported as SQL. Service Broker provides similar functionality but with a very different architecture and syntax.
Oracle Alternative syntax
Not supported as SQL. DBMS_ALERT and DBMS_PIPE PL/SQL packages provide async signaling but are PL/SQL-only.
SQLite Alternative syntax
Not supported. SQLite is a single-process embedded database with no server process to hold pub/sub channels.