Can we call a trigger function in a stored procedure.
+5
A:
A trigger is automatically executed. So, dependant on what your Stored Procedure is doing, it will get called.
http://www.postgresql.org/docs/8.1/interactive/triggers.html
Ardman
2010-06-11 10:16:05
Yes, but is there a way to explictly call a trigger function.
apn
2010-06-11 10:19:52
As far as i know there isn't. Triggers are only automattically executed.
Rob
2010-06-11 10:21:40
Can we supress the action that caused the trigger to fire when we met some criteria in the trigger.
apn
2010-06-11 10:55:21
ex:In my stored procedure i have and insert statement on table xxxxx.I have trigger on xxxxxx table on before insert.In the trigger im checking if there exists a record with same id on the table,if i found any record i will update the table and should not allow to the insert to be executed.
apn
2010-06-11 11:03:34
[Yes](http://www.postgresql.org/docs/current/static/plpgsql-trigger.html).
Milen A. Radev
2010-06-11 11:06:35
Just return NULL to suppress.
rfusca
2010-06-11 13:49:56