Fwd: Trigger on VIEW not firing

From: Massimo Costantini <massimo(dot)costantini(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Fwd: Trigger on VIEW not firing
Date: 2013-07-30 12:40:49
Message-ID: CAO_q5tsojLQOJCD2sB7SnMKvfwBE+BTG17mMBtD5xd4EEB3bLw@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?

In response to

Responses

Browse pgeu-general by date

  From Date Subject
Next Message Ian Lawrence Barwick 2013-07-30 12:49:58 Re: Fwd: Trigger on VIEW not firing
Previous Message Massimo Costantini 2013-07-30 12:27:53 Trigger on VIEW not firing

Browse pgsql-general by date

  From Date Subject
Next Message Ian Lawrence Barwick 2013-07-30 12:49:58 Re: Fwd: Trigger on VIEW not firing
Previous Message Massimo Costantini 2013-07-30 12:27:53 Trigger on VIEW not firing