Hi,
I have a problem with Triggers on VIEW:
CREATE TABLE work (
id integer NOT NULL,
work TEXT,
worktype TEXT
);
CREATE VIEW worksub AS SELECT FROM work WHERE worktype='subordinate';
CREATE OR REPLACE FUNCTION wrk_view() RETURNS TRIGGER AS $wrk_tg$
BEGIN
RAISE NOTICE 'UPDATE VIEW FROM: % OPERATION: %',TG_TABLE_NAME, TG_OP;
END;
$wrk_tg$ LANGUAGE plpgsql;
CREATE TRIGGER wrk_tg INSTEAD OF INSERT OR DELETE OR UPDATE ON worksub
FOR EACH ROW EXECUTE PROCEDURE wrk_view();
nothing appen when I insert row in work table.
Someone can help me?
suppose I have:
);
CREATE OR REPLACE FUNCTION wrk_view() RETURNS TRIGGER AS $wrk_tg$
BEGIN
RAISE NOTICE 'UPDATE VIEW FROM: % OPERATION: %',TG_TABLE_NAME, TG_OP;
END;
$wrk_tg$ LANGUAGE plpgsql;
CREATE TRIGGER wrk_tg INSTEAD OF INSERT OR DELETE OR UPDATE ON worksub
FOR EACH ROW EXECUTE PROCEDURE wrk_view();