From: Michael P. <mic...@gm...> - 2013-05-10 12:29:25
|
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 - 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). 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 |