pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: George Neuner <gneuner2@comcast.net>
To: pgsql-general@postgresql.org
Subject: Re: Watching for view changes
Date: Mon, 24 Dec 2018 02:59:16 -0500
Message-ID: <fn312edf5of0bqb7slutidql7in758voro@4ax.com> (raw)
References: <CAKLmikP+PPB49z8rEEvRjFOD0D2DV72KdqYN7s9fjh9sM_32ZA@mail.gmail.com>
	<CAO8ar=mpjafnXPY9sFgPeC0R+uY-S_Wqqd3iBHPCczARkEPo9A@mail.gmail.com>
	<CAKLmikOjY59ROJ-qwBd6G0Q29t5LMbepuVomNbiFpwjz3sb1pA@mail.gmail.com>
	<1iho1ehdf227kvm7p6vn11hg11jf19i8iv@4ax.com>
	<CAKLmikOTYwuOo=m3x0uaLhrQqo8CpKA5WksCBnYEVkjLxp6+Hw@mail.gmail.com>
	<g0hr1e91hi97enem31qgucu6bar6b0s47v@4ax.com>
	<CAKLmikN=J+96wDX_PX1CGnKo9gK5=jVpR+Tbn06dd5gcnC3fqg@mail.gmail.com>

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





view thread (31+ messages)  latest in thread

Message-ID: <fn312edf5of0bqb7slutidql7in758voro@4ax.com>
Permalink:  ../fn312edf5of0bqb7slutidql7in758voro@4ax.com/
Also on:    postgresql.org/message-id/fn312edf5of0bqb7slutidql7in758voro@4ax.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: gneuner2@comcast.net
  Subject: Re: Watching for view changes
  In-Reply-To: <fn312edf5of0bqb7slutidql7in758voro@4ax.com>
  References: <CAKLmikP+PPB49z8rEEvRjFOD0D2DV72KdqYN7s9fjh9sM_32ZA@mail.gmail.com> <CAO8ar=mpjafnXPY9sFgPeC0R+uY-S_Wqqd3iBHPCczARkEPo9A@mail.gmail.com> <CAKLmikOjY59ROJ-qwBd6G0Q29t5LMbepuVomNbiFpwjz3sb1pA@mail.gmail.com> <1iho1ehdf227kvm7p6vn11hg11jf19i8iv@4ax.com> <CAKLmikOTYwuOo=m3x0uaLhrQqo8CpKA5WksCBnYEVkjLxp6+Hw@mail.gmail.com> <g0hr1e91hi97enem31qgucu6bar6b0s47v@4ax.com> <CAKLmikN=J+96wDX_PX1CGnKo9gK5=jVpR+Tbn06dd5gcnC3fqg@mail.gmail.com> <fn312edf5of0bqb7slutidql7in758voro@4ax.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox