1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Add new function pg_notification_queue_usage.

This tells you what fraction of NOTIFY's queue is currently filled.

Brendan Jurd, reviewed by Merlin Moncure and Gurjeet Singh.  A few
further tweaks by me.
This commit is contained in:
Robert Haas
2015-07-17 09:12:03 -04:00
parent 43d89a23d5
commit a04bb65f70
10 changed files with 115 additions and 19 deletions

View File

@ -14805,6 +14805,12 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
<entry>channel names that the session is currently listening on</entry>
</row>
<row>
<entry><literal><function>pg_notification_queue_usage()</function></literal></entry>
<entry><type>double</type></entry>
<entry>fraction of the asynchronous notification queue currently occupied (0-1)</entry>
</row>
<row>
<entry><literal><function>pg_my_temp_schema()</function></literal></entry>
<entry><type>oid</type></entry>
@ -14945,10 +14951,19 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ..
<primary>pg_listening_channels</primary>
</indexterm>
<indexterm>
<primary>pg_notification_queue_usage</primary>
</indexterm>
<para>
<function>pg_listening_channels</function> returns a set of names of
channels that the current session is listening to. See <xref
linkend="sql-listen"> for more information.
asynchronous notification channels that the current session is listening
to. <function>pg_notification_queue_usage</function> returns the
fraction of the total available space for notifications currently
occupied by notifications that are waiting to be processed, as a
<type>double</type> in the range 0-1.
See <xref linkend="sql-listen"> and <xref linkend="sql-notify">
for more information.
</para>
<indexterm>

View File

@ -165,6 +165,11 @@ NOTIFY <replaceable class="PARAMETER">channel</replaceable> [ , <replaceable cla
cleanup. In this case you should make sure that this session ends its
current transaction so that cleanup can proceed.
</para>
<para>
The function <function>pg_notification_queue_usage</function> returns the
fraction of the queue that is currently occupied by pending notifications.
See <xref linkend="functions-info"> for more information.
</para>
<para>
A transaction that has executed <command>NOTIFY</command> cannot be
prepared for two-phase commit.