Re: Transaction ID in Triggers

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Transaction ID in Triggers
Дата
Msg-id 407d949e0908141325g10578e48ic830df96297787d0@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Transaction ID in Triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
On Fri, Aug 14, 2009 at 9:08 PM, Tom Lane<tgl@sss.pgh.pa.us> wrote:
> 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
betteraudit 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().

For an auditing mechanism you probably just want to use the whole of
txid_current() anyways.

--
greg
http://mit.edu/~gsstark/resume.pdf

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

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