Re: Transaction ID in Triggers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Transaction ID in Triggers
Дата
Msg-id 22497.1250280496@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Transaction ID in Triggers  (David Saracini <dsaracini@yahoo.com>)
Ответы Re: Transaction ID in Triggers  (Greg Stark <gsstark@mit.edu>)
Re: Transaction ID in Triggers  (David Saracini <dsaracini@yahoo.com>)
Список pgsql-novice
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
audittrail 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

В списке pgsql-novice по дате отправления:

Предыдущее
От: David Saracini
Дата:
Сообщение: Transaction ID in Triggers
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Transaction ID in Triggers