The trigger is on the view and fires when you query the view:
# DELETE FROM worksub;
NOTICE: UPDATE VIEW FROM: worksub OPERATION: DELETE
ERROR: control reached end of trigger procedure without RETURN
CONTEXT: PL/pgSQL function wrk_view()
On Tue, Jul 30, 2013 at 6:10 PM, Massimo Costantini <massimo.costantini@xxxxxxxxx> wrote:
Hi,Someone can help me?nothing appen when I insert row in work table.CREATE VIEW worksub AS SELECT FROM work WHERE worktype='subordinate';worktype TEXTwork TEXT,id integer NOT NULL,I have a problem with Triggers on VIEW:suppose I have:
CREATE TABLE work (
);
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();
Beena Emerson