Re: Triggers on transaction?

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: Triggers on transaction?
Дата
Msg-id 20150527110717.GB4853@depesz.com
обсуждение исходный текст
Ответ на Re: Triggers on transaction?  (Jordan Gigov <coladict@gmail.com>)
Ответы Re: Triggers on transaction?  (Benedikt Grundmann <bgrundmann@janestreet.com>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jordan Gigov
Дата:
Сообщение: Re: Triggers on transaction?
Следующее
От: Benedikt Grundmann
Дата:
Сообщение: Re: Triggers on transaction?