Hi, Can I call multiple functions in one trigger? Something like this: CREATE TRIGGER match_cond_name_generate BEFORE INSERT OR UPDATE ON public.predicate_index FOR EACH ROW EXECUTE PROCEDURE public.match_cond_name_generate(); EXECUTE PROCEDURE public.create_predicate_table(); Postgresql won't allow me to do this. Multiple triggers won't guarantee the order of the operations. Do I have to put everything into one single function? Many thanks, Wei Wang
"Wei Wang" <ww220@cam.ac.uk> writes:
> Can I call multiple functions in one trigger?
No. Use multiple triggers.
> Postgresql won't allow me to do this. Multiple triggers won't guarantee the
> order of the operations.
Sure they will (in recent releases anyway). Triggers are fired
alphabetically.
regards, tom lane
Tom Lane said: > "Wei Wang" <ww220@cam.ac.uk> writes: >> Can I call multiple functions in one trigger? You could create a "wrapper" function that the trigger calls, which then calls all the other functions that you need to call, in the order in which they are defined in the wrapper function. John Suidney-Woollett
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера