- 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