DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Resource Usage / Disk

max_notify_queue_pages

Sets the maximum number of allocated pages for NOTIFY / LISTEN queue.

  • Default: 1048576
  • Type: integer
  • Range: 64 … 2147483647
  • Applies: Restart required

In plain words

Notifications wait in a queue until every listening session has read them. A listener that stays inside a long transaction never reads, so the queue grows. This caps that growth: when the queue is full, new NOTIFY calls fail.

For DBAs and operators

Added in PostgreSQL 17 (before, the limit was a hard-coded 8 GB). The queue lives in pg_notify/; the cache in front of it is notify_buffers. When the queue is half full the server warns, naming the blocking process:

WARNING: NOTIFY queue is 50% full
DETAIL: The server process with PID 4711 is among those with the oldest transactions.
HINT: The NOTIFY queue cannot be emptied until that process ends its current transaction.

When full, the committing transaction fails with ERROR: too many notifications in the NOTIFY queue. Fix the listener (it must not sit "idle in transaction"); the current fill is shown by SELECT pg_notification_queue_usage();.

How to change it

Change in postgresql.conf or ALTER SYSTEM, then restart the server.

See it in context

SLRU caches

Related parameters

notify_buffers

All Resource Usage parameters