This page needs an example to understand that you **need** to explicitly call LISTEN before using getNotify, like shown in https://www.php.net/manual/en/function.pg-get-notify.php
<?php
$db = new PDO($dsn, $user, $password, $options);
$db->query('LISTEN test');
$notification = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 10000);
$db = new Pdo\Pgsql($dsn, $user, $password, $options);
$db->query('LISTEN test');
$notification = $db->getNotify(PDO::FETCH_ASSOC, 10000);
var_dump($notification);
?>
array(3) {
["message"]=>
string(4) "test"
["pid"]=>
int(123565)
["payload"]=>
string(14) "payload string"
}
If you called NOTIFY before calling LISTEN, nothing will be returned!
You receive the first notification only, and you have to call getNotify again. And call LISTEN again if DB connection drops.