"Omkar Rath" <[EMAIL PROTECTED]> writes: > Say there is a stored procedure i.e FUNCTION sp_foo(...) which has say, > SQL commands (any of SELECT,INSERT,UPDATE,DELETE) in its body, say S1 > followed by S2 then S3.... Furthermore, execution of statement S2 > results in trigger functions getting invoked (that contain yet other SQL > statements). > > By the time, the trigger functions execute (as a result of S2), S3 has > already executed.
In existing PG releases, AFTER triggers are always fired at the completion of the whole interactive command (ie, the outer SELECT that called sp_foo). There are changes in 8.0 to fire them at the end of the specific query that triggered them, which I believe will do what you want. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly