Re: Triggers on transaction?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Jordan Gigov <coladict(at)gmail(dot)com>
Cc: Marko Tiikkaja <marko(at)joh(dot)to>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Triggers on transaction?
Date: 2015-05-27 11:07:17
Message-ID: 20150527110717.GB4853@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 27, 2015 at 01:55:24PM +0300, Jordan Gigov wrote:
> Updating a materialized view in my case. It should only update when 2-3 of
> our 30+ tables get new data, which for those is kind of rare. Not having
> such a trigger means I will have to call it in each usage in the code and
> hope future maintainers don't forget it. This is why I postponed migrating
> the one search query where materialized views would be useful, because it's
> heavy.

Add daemon which runs "LISTEN", and triggers on the underlying tables
that do NOTIFY.
When daemon picks something from LISTEN (which happens only after
commit) - it can do anything that needs to be done, and it will not
block the transaction, which is an added benefit.

depesz

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Benedikt Grundmann 2015-05-27 11:15:19 Re: Triggers on transaction?
Previous Message Jordan Gigov 2015-05-27 10:55:24 Re: Triggers on transaction?