Re: "xmin" system column - Mailing list pgsql-general

From Michael Fuhr
Subject Re: "xmin" system column
Date
Msg-id 20060126222250.GA98775@winnie.fuhr.org
Whole thread Raw
In response to Re: "xmin" system column  ("Eric B. Ridge" <ebr@tcdi.com>)
Responses Re: "xmin" system column  (Michael Fuhr <mike@fuhr.org>)
Re: "xmin" system column  ("Eric B. Ridge" <ebr@tcdi.com>)
List pgsql-general
On Thu, Jan 26, 2006 at 05:05:19PM -0500, Eric B. Ridge wrote:
> I really need a way to create a unique identifier at the start of a
> top-level transaction, and be able to use it via triggers and/or
> column default values in that or its subtransactions.

I suppose a sequence is out of the question?  Too easy to get it
wrong?

> Is there some kind of "TopXID" magic variable/function that I haven't
> found in the documentation?

Not in the standard installation, but I think a C function that
returns GetTopTransactionId() should work.  It's trivial to write
and examples have been posted before; search the archives.

--
Michael Fuhr

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: "xmin" system column
Next
From: Michael Fuhr
Date:
Subject: Re: "xmin" system column