aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/sql/async.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/sql/async.sql')
-rw-r--r--src/test/regress/sql/async.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/regress/sql/async.sql b/src/test/regress/sql/async.sql
new file mode 100644
index 00000000000..af3a904e0f5
--- /dev/null
+++ b/src/test/regress/sql/async.sql
@@ -0,0 +1,19 @@
+--
+-- 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 *;