I have some code thats works Ok in PHP. From the postgres CLI I issue a
NOTIFY job;
The notification is correctly raised by Postgres ( I can see it in the PHP client), but can't read it in node.
JS:
var pg = require('pg');
var conString = "your postgres information";
var client = new pg.Client(conString);
client.connect();
client.query('LISTEN job');
client.on('notification', function(msg) {
console.log('data');
});
I would prefer to keep it simple. Is the only way to make a procedure in postgres like this?