From a04bb65f70dafdf462e0478ad19e6de56df89bfc Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 17 Jul 2015 09:12:03 -0400 Subject: 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. --- src/test/regress/expected/async.out | 8 ++++++++ src/test/regress/sql/async.sql | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'src/test/regress') diff --git a/src/test/regress/expected/async.out b/src/test/regress/expected/async.out index ae0d5df3b78..19cbe38e636 100644 --- a/src/test/regress/expected/async.out +++ b/src/test/regress/expected/async.out @@ -32,3 +32,11 @@ NOTIFY notify_async2; LISTEN notify_async2; UNLISTEN notify_async2; UNLISTEN *; +-- Should return zero while there are no pending notifications. +-- src/test/isolation/specs/async-notify.spec tests for actual usage. +SELECT pg_notification_queue_usage(); + pg_notification_queue_usage +----------------------------- + 0 +(1 row) + diff --git a/src/test/regress/sql/async.sql b/src/test/regress/sql/async.sql index af3a904e0f5..40f6e015387 100644 --- a/src/test/regress/sql/async.sql +++ b/src/test/regress/sql/async.sql @@ -17,3 +17,7 @@ NOTIFY notify_async2; LISTEN notify_async2; UNLISTEN notify_async2; UNLISTEN *; + +-- Should return zero while there are no pending notifications. +-- src/test/isolation/specs/async-notify.spec tests for actual usage. +SELECT pg_notification_queue_usage(); -- cgit v1.2.3