From: | Massimo Costantini <massimo(dot)costantini(at)gmail(dot)com> |
---|---|
To: | pgeu-general(at)postgresql(dot)org |
Subject: | Trigger on VIEW not firing |
Date: | 2013-07-30 12:27:53 |
Message-ID: | CAO_q5tu7XQUujbsJw2xyXhKrgs3_nAejy0UQRTfDcC_XyEkj4g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgeu-general pgsql-general |
Hi,
I have a problem with Triggers on VIEW:
suppose I have:
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?
From | Date | Subject | |
---|---|---|---|
Next Message | Massimo Costantini | 2013-07-30 12:40:49 | Fwd: Trigger on VIEW not firing |
Previous Message | Guillaume Lelarge | 2013-07-21 08:20:38 | Call for papers - PGConf.EU 2013 - extended till 07/29! |
From | Date | Subject | |
---|---|---|---|
Next Message | Massimo Costantini | 2013-07-30 12:40:49 | Fwd: Trigger on VIEW not firing |
Previous Message | Ingmar Brouns | 2013-07-30 10:03:25 | Re: to_char with locale decimal separator |