CREATE OR REPLACE FUNCTION alert_zc_notify() RETURNS trigger AS $$
BEGIN
	PERFORM pg_notify( 'zc', NEW.pn || ',' || NEW._id );
	RETURN NULL; -- after trigger, result is ignored
END;
$$ LANGUAGE plpgsql;

-- DROP TRIGGER alert_zc_trigger ON zc;

CREATE TRIGGER alert_zc_trigger
AFTER INSERT ON zc
FOR EACH ROW EXECUTE FUNCTION alert_zc_notify();

