Re: Transaction IDs not the same in same transaction?

From: Christian Kratzer <ck(at)cksoft(dot)de>
To: Christian Kratzer <ck(at)cksoft(dot)de>
Cc: Steve V <dndlists(at)gmail(dot)com>, Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Transaction IDs not the same in same transaction?
Date: 2005-10-23 15:42:41
Message-ID: 20051023174123.G9540@vesihiisi.cksoft.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)fuhr(dot)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(at)cksoft(dot)de
CK Software GmbH http://www.cksoft.de/
Phone: +49 7452 889 135 Fax: +49 7452 889 136

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2005-10-23 16:48:38 Re: pg_autovacuum (8.0.4) as Windows service ?
Previous Message Tom Lane 2005-10-23 15:40:48 Re: Transaction IDs not the same in same transaction?