From: Ashutosh B. <ash...@en...> - 2013-05-10 12:31:25
|
On Fri, May 10, 2013 at 5:59 PM, Michael Paquier <mic...@gm...>wrote: > > > > On Fri, May 10, 2013 at 2:59 PM, Ashutosh Bapat < > ash...@en...> wrote: > >> Can you comment on this, since you are the one who implemented statement >> triggers? >> > About the shippability of triggers, here is some food for brain: > http://michael.otacoo.com/postgresql-2/triggers-in-a-cluster-database/ > > In short, a trigger can be fired on a remote node only if: > - the query that triggered it is FQSed > That's busted, and hence this whole mail tread. > - the fired procedure is immutable. There might be cases where a trigger > with a stable procedure could be shippable but this would be dangerous... > There are already some APIs I implemented that you can use if they are not > used already (trigger.c or something in the shippability APIs of the > optimizer I don't recall precisely). > Unfortunately those APIs are found to be heavily erroneous and Amit is currently working on writing correct APIs. > > Just knowing that 99% of triggers do not use immutable functions is enough > to shoot all the triggers on Coordinators, you will be bad performance for > row triggers but if you don't do that data consistency is badly endangered. > However for correctness you should open the open to immutable triggers > being shippable. > -- > Michael > -- Best Wishes, Ashutosh Bapat EntepriseDB Corporation The Postgres Database Company |