On Sun, Oct 23, 2005 at 02:00:47PM -0700, Steve V wrote: > > Ah, you had not even mentioned that the trigger was in pltcl. > > spi_exec runs everything in subtransactions as of 8.0, so that > > it can catch errors and propagate them back as Tcl errors. > > Okay, so are there any possible options? Would GetTopTransactionId() > work, as Michael suggested further up? I just did some tests with a pltcl function that uses spi_exec in an AFTER trigger and GetTopTransactionId() returned the same value for each of several inserts and updates that were in the same transaction. However, I can't say whether this will work for you without seeing your code. It would be easier for us to help -- and you'd get a solution sooner -- if you'd post a minimal but complete example that shows what you're doing and that exhibits the behavior you're seeing. -- Michael Fuhr ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly