Re: Triggers on transaction?

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Triggers on transaction?
Дата
Msg-id CANP8+jJbHtqFmwCMNYxxmU+AYQWRun_TpuovW-3dihFSEYXdWg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Triggers on transaction?  (Jordan Gigov <coladict@gmail.com>)
Ответы Re: Triggers on transaction?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 27 May 2015 at 11:55, Jordan Gigov <coladict@gmail.com> 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.

I don't understand why maintaining rows once per transaction saves any effort/provides any convenience.

Would the TransactionTrigger get access to changed rows? Can't you just use deferred triggers?
 
I'm not clear exactly when such a trigger should run. If the trigger issues more SQL, which also has triggers... do we run the PreCommit trigger twice? Or just accept that we wanted it to run just prior to commit but it kinda didn't?

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

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