PostgreSQL · infra · fg-0269
LISTEN never receives notifications even though NOTIFY and pg_notify succeed
The listener stays silent while pg_notify calls return without error
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
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;Affects: PostgreSQL 13 through 18; Supabase Supavisor transaction mode, as of October 2026; vendor policy, re-check by 2026-12-15
Sources
- https://www.postgresql.org/docs/current/sql-notify.html
- https://supabase.com/docs/guides/database/connecting-to-postgres
- https://github.com/postgres/postgres/blob/REL_17_STABLE/src/backend/commands/async.c
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp