From c2fc50b63cb6517e51a1203bbce87f29ea09ca84 Mon Sep 17 00:00:00 2001
From: Arseniy Mukhin <arseniy.mukhin.dev@gmail.com>
Date: Wed, 15 Oct 2025 11:43:26 +0300
Subject: [PATCH] listen notify test

---
 contrib/amcheck/meson.build            |  1 +
 contrib/amcheck/t/007_listen-notify.pl | 33 ++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 contrib/amcheck/t/007_listen-notify.pl

diff --git a/contrib/amcheck/meson.build b/contrib/amcheck/meson.build
index 1f0c347ed54..ad5b4b01f79 100644
--- a/contrib/amcheck/meson.build
+++ b/contrib/amcheck/meson.build
@@ -50,6 +50,7 @@ tests += {
       't/004_verify_nbtree_unique.pl',
       't/005_pitr.pl',
       't/006_verify_gin.pl',
+      't/007_listen-notify.pl',
     ],
   },
 }
diff --git a/contrib/amcheck/t/007_listen-notify.pl b/contrib/amcheck/t/007_listen-notify.pl
new file mode 100644
index 00000000000..dc9d0ca071d
--- /dev/null
+++ b/contrib/amcheck/t/007_listen-notify.pl
@@ -0,0 +1,33 @@
+
+# Copyright (c) 2021-2025, PostgreSQL Global Development Group
+
+use strict;
+use warnings FATAL => 'all';
+
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
+
+use Test::More;
+
+my $node;
+
+#
+# Test set-up
+#
+$node = PostgreSQL::Test::Cluster->new('test');
+$node->init();
+$node->start();
+
+my $listener = $node->background_psql('postgres');
+
+$listener->query_safe("LISTEN ch");
+
+$node->safe_psql("postgres","NOTIFY ch,'aa'");
+my $res = $listener->query_safe("select 'AAAAAAAAA';");
+
+like($res, qr/Asynchronous notification "ch" with payload "aa" received from server process/);
+
+$listener->quit();
+
+
+done_testing();
-- 
2.43.0

