Hi,
On Sun, 23 Oct 2005, Christian Kratzer wrote:
> Hi,
>
> On Sat, 22 Oct 2005, Steve V wrote:
>
>> On 10/22/05, Michael Fuhr <mike@fuhr.org> wrote:
> [snipp]
>> I'm using this for an auditing script, and want to use the txn ID to
>> indicate an atomic set of changes(the pg txn ID is mapped to my own
>> txn ID to avoid wraparound issues). I would rather not use xmin, as it
>> is not available directly in any of the triggers(as far as I know). So
>> I would have to construct select statements on the fly, and I would
>> rather not do that. I'm open to suggestions though.
>
> we use a touple of (now(),session_backend_pid()) in our logging triggers
> to identify stuff done in the same transaction.
>
> now() will be frozen during the transaction and session_backend_pid()
> disambuguates this for cases where two transaction could have the
> same start time.
I of course meant a tuple of now() and pg_backend_pid().
session_backend_pid is the name of a column in our session table.
Greetings
Christian
--
Christian Kratzer ck@cksoft.de
CK Software GmbH http://www.cksoft.de/
Phone: +49 7452 889 135 Fax: +49 7452 889 136