Thank you for the quick reply. Unfortunately, I have a couple of more questions. :)
So, if I understand it... then, txid_current returns the xmax in the high-order and the xmin in the low-order. Correct? and the xmax is the transaction that deleted the tuple and the xmin stores the last transaction that (inserted or modified). Correct?
Thanks - and Regards,
David
From: Tom Lane <tgl@sss.pgh.pa.us> To: David Saracini <dsaracini@yahoo.com> Cc: pgsql novice forum <pgsql-novice@postgresql.org> Sent: Friday, August 14, 2009 1:08:16 PM Subject: Re: [NOVICE] Transaction ID in Triggers
David Saracini <dsaracini@yahoo.com> writes: > Is there a way to find out the current transaction id from within a Trigger? I'm interested in implementing a better audit trail mechanism and this would help me greatly.
If you have your hands on a row that was inserted or updated by the current transaction, you could look at its xmin. Another possibility (in recent releases) is to take the low-order 32 bits of txid_current().