Re: Watching for view changes - Mailing list pgsql-general

From George Neuner
Subject Re: Watching for view changes
Date
Msg-id fn312edf5of0bqb7slutidql7in758voro@4ax.com
Whole thread Raw
In response to Watching for view changes  (Mitar <mmitar@gmail.com>)
Responses Re: Watching for view changes  (Mitar <mmitar@gmail.com>)
List pgsql-general
On Sun, 23 Dec 2018 23:06:51 -0800, Mitar <mmitar@gmail.com> wrote:

>On Fri, Dec 21, 2018 at 11:10 PM George Neuner <gneuner2@comcast.net> wrote:
>> A materialized view IS exactly such a deliberate cache of results from
>> applying a view.  It is a real table that can be monitored for changes
>> using INSERT, UPDATE and/or DELETE triggers.
>
>Are you sure one can use triggers on a materialized view? I am getting:
>
>"my_materialized_view" is not a table or view
>
>as an error when I am trying to create a trigger on materialized view.

IIRC the cache table's name is generated.  I don't know the proper
incantations to get it from the catalogs, but an easy way to find it
is to put the materialized view into its own tablespace, then search
pg_tables for objects in that space.

George



pgsql-general by date:

Previous
From: Mitar
Date:
Subject: Re: Watching for view changes
Next
From: George Neuner
Date:
Subject: Re: Watching for view changes