| From: | Christian Kratzer <ck-lists(at)cksoft(dot)de> |
|---|---|
| To: | Steve V <dndlists(at)gmail(dot)com> |
| Cc: | 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 07:26:13 |
| Message-ID: | 20051023092357.S6332@vesihiisi.cksoft.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
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.
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2005-10-23 15:13:15 | Re: Transaction IDs not the same in same transaction? |
| Previous Message | Bruno Wolff III | 2005-10-23 06:02:19 | Re: [pgsql-advocacy] Oracle buys Innobase |