DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Developer Options

trace_notify

Generates debugging output for LISTEN and NOTIFY.

  • Default: off
  • Type: bool
  • Applies: Session (any user)

In plain words

Prints a debug message at each internal step of LISTEN and NOTIFY: registering a listener, queuing a notification at commit, and delivering it. Only useful when chasing a problem in asynchronous notifications.

For DBAs and operators

The messages are at DEBUG1, so you only see them if client_min_messages or log_min_messages is debug1 or lower. Captured on 18.6 with client_min_messages = debug1:

DEBUG: Async_Listen(foo,1142)DEBUG: PreCommit_NotifyDEBUG: Exec_ListenPreCommit(1142)DEBUG: AtCommit_NotifyDEBUG: Async_Notify(foo)DEBUG: ProcessIncomingNotifyDEBUG: ProcessIncomingNotify: done

The notification itself is delivered only at commit, which these lines make visible. For production problems with notifications, check pg_notification_queue_usage() first: a long-idle listener in an open transaction prevents the queue from being cleaned up and eventually makes NOTIFY fail with too many notifications in the NOTIFY queue.

Developer option: meant for debugging and testing PostgreSQL itself. Leave it at the default on production servers unless a specific diagnosis calls for it.

How to change it

Any user can change it for their session with SET.

See it in context

Client backend

Related parameters

client_min_messages log_min_messages

All Developer Options parameters