CREATE OR REPLACE FUNCTION notify_notification_queue()
RETURNS trigger AS $$
BEGIN
  PERFORM pg_notify('taf_queue', row_to_json(NEW)::text);
  RETURN NEW;
END;
$$ LANGUAGE plpgsql;

DROP TRIGGER IF EXISTS notification_notify ON notification_queue;
CREATE TRIGGER notification_notify
AFTER INSERT ON notification_queue
FOR EACH ROW EXECUTE PROCEDURE notify_notification_queue();
