Create trigger on Materialized View?

From: Matthew Syphus <MSyphus(at)lhtac(dot)org>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Create trigger on Materialized View?
Date: 2016-03-31 16:30:33
Message-ID: 9A88082E9F46DF469E9FBDE77881044701307D1C@lhtacexch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would like a trigger on a materialized view. Is this possible? I have tried both an INSTEAD OF and BEFORE trigger with no luck. It responds with:
"project_milestone_mv" is not a table or view.
It is absolutely present and spelled correctly. It is the same with or without the schema qualification. Actual statement:

CREATE TRIGGER project_milestone_upsert_trigger INSTEAD OF UPDATE
ON tracking.project_milestone_mv FOR EACH ROW
EXECUTE PROCEDURE tracking.project_milestone_upsert();

The documentation at http://www.postgresql.org/docs/current/static/sql-createtrigger.html does not explicitly exclude nor include materialized views. The most pertinent part I've found simply states "The trigger will be associated with the specified table, view, or foreign table" and later in reference to table_name, "The name (optionally schema-qualified) of the table, view, or foreign table the trigger is for." I've found no mailing list entry addressing triggers and whether "view" does not include _materialized_ view.
Does this indicate, then, that materialized views cannot have triggers?

Postgres 9.5.1
CentOS 6.5

Thank you,
MS

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2016-03-31 16:38:05 Re: Create trigger on Materialized View?
Previous Message Pavlov, Vladimir 2016-03-31 15:31:18 Re: Multixacts wraparound monitoring