By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,660 Members | 1,953 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,660 IT Pros & Developers. It's quick & easy.

How do I call multiple functions in one trigger?

P: n/a
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
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Wei Wang" <ww***@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

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #2

P: n/a
Tom Lane said:
"Wei Wang" <ww***@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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.