mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 18:01:17 +02:00
a04bb65f70
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.
24 lines
767 B
SQL
24 lines
767 B
SQL
--
|
|
-- ASYNC
|
|
--
|
|
|
|
--Should work. Send a valid message via a valid channel name
|
|
SELECT pg_notify('notify_async1','sample message1');
|
|
SELECT pg_notify('notify_async1','');
|
|
SELECT pg_notify('notify_async1',NULL);
|
|
|
|
-- Should fail. Send a valid message via an invalid channel name
|
|
SELECT pg_notify('','sample message1');
|
|
SELECT pg_notify(NULL,'sample message1');
|
|
SELECT pg_notify('notify_async_channel_name_too_long______________________________','sample_message1');
|
|
|
|
--Should work. Valid NOTIFY/LISTEN/UNLISTEN commands
|
|
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();
|