PostgreSQL · infra · fg-0269

LISTEN never receives notifications even though NOTIFY and pg_notify succeed

If you see The listener stays silent while pg_notify calls return without error, the cause and the fix for PostgreSQL are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
The listener stays silent while pg_notify calls return without errorNotifications arrive late, only after the sending transaction commitsERROR: payload string too long
Cause
NOTIFY inside a transaction is delivered only at commit, and LISTEN belongs to a single server session, so through a transaction-mode pooler the session that ran LISTEN is handed to other clients. Payloads must be shorter than 8000 bytes by default.
Fix
Keep a dedicated direct or session-mode connection for listeners, commit the sending transaction, and send row ids instead of large payloads.
Apply
-- listener: direct or session-mode connection, never the transaction pooler LISTEN jobs; -- sender BEGIN; INSERT INTO jobs (id) VALUES (123); SELECT pg_notify('jobs', '123'); COMMIT;
Affected
PostgreSQL 13 through 18; Supabase Supavisor transaction mode, as of October 2026; vendor policy, re-check by 2026-12-15
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun