> 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. Okay, so using GetTopTransactionId() will do the trick it sounds like. To see all of what's happening, just place the pltcl function that I posted earlier in this thread as an AFTER trigger, and run code similar to that which I showed in my first post to start the thread. Which library is GetTopTransactionId() available in? Do I need to compile an library on my own that will expose it? ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster