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,
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Saracini <dsaracini(at)yahoo(dot)com>
Cc: pgsql novice forum <pgsql-novice(at)postgresql(dot)org>
Sent: Friday, August 14, 2009 1:08:16 PM
Subject: Re: [NOVICE] Transaction ID in Triggers
David Saracini <dsaracini(at)yahoo(dot)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().
regards, tom lane
In response to
pgsql-novice by date
|Next:||From: Tom Lane||Date: 2009-08-14 20:38:20|
|Subject: Re: Transaction ID in Triggers |
|Previous:||From: Greg Stark||Date: 2009-08-14 20:25:09|
|Subject: Re: Transaction ID in Triggers|