You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create table example_table(id serial primary key, uname text not null, age integer);
CREATE FUNCTION public.notify() RETURNS trigger LANGUAGE 'plpgsql' AS $FUNCTION$ BEGIN PERFORM pg_notify('change', row_to_json(NEW)::text); RETURN NEW; END; $FUNCTION$;
CREATE TRIGGER update AFTER UPDATE ON todo FOR EACH ROW EXECUTE PROCEDURE notify();
CREATE TRIGGER remove AFTER DELETE ON todo FOR EACH ROW EXECUTE PROCEDURE notify();
CREATE TRIGGER change AFTER INSERT ON todo FOR EACH ROW EXECUTE PROCEDURE notify();