useless work, for example, reading a database table to
find the same updates that that session just wrote out. It is
possible to avoid such extra work by noticing whether the notifying
session's server process <acronym>PID</acronym> (supplied in the
notification event message) is the same as one's own session's
<acronym>PID</acronym> (available from <application>libpq</application>). When they
are the same, the notification event is one's own work bouncing
back, and can be ignored.
</para>
</refsect1>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><replaceable class="parameter">channel</replaceable></term>
<listitem>
<para>
Name of the notification channel to be signaled (any identifier).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">payload</replaceable></term>
<listitem>
<para>
The <quote>payload</quote> string to be communicated along with the
notification. This must be specified as a simple string literal.
In the default configuration it must be shorter than 8000 bytes.
(If binary data or large amounts of information need to be communicated,
it's best to put it in a database table and send the key of the record.)
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
There is a queue that holds notifications that have been sent but not
yet processed by all listening sessions. If this queue becomes full,
transactions calling <command>NOTIFY</command> will fail at commit.
The queue is quite large (8GB in a standard installation) and should be
sufficiently sized for almost every use case. However, no cleanup can take
place if a session executes <command>LISTEN</command> and then enters a
transaction for a very long time. Once the queue is half full you will see
warnings in the log file pointing you to the session that is preventing
cleanup. In this case you should