I understand that: 1) you like to use postgres as a "bus" to transfer messages between connected clients;
2) only one database server is concerned (no redundancy at all);
3) it is the client code (perl, php ...) that send the notification (ie, notifications are not sent by triggers for example)
May be you could dedicate one of your database to do this; all clients could listen messages on this database and some client code would decode the payload and does its job.
What I meant was that the notifications are received by the client connections as if it was generated within their corresponding database (let's name the database with a client connection listening to it; DB_C), then a notification generated by a NOTIFY command within DB_X like this:
pg_notify_db('DB_C', some_channel, 'payload');
can be heard by the client. Of course, the client needs to know which database has sent the notification but I think we can skip that part since we can easily include database name in the notification's payload if necessary.
That was one of the two solutions. The other one is like this:
pg_notify_all(some_channel, 'payload');
And this one sends the notification to all of the client connections, regardless of which database they are connected/listening to.