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

From Eric B. Ridge
Subject Re: "xmin" system column
Date
Msg-id 5071266A-78E7-40DD-87EA-2419B10DA545@tcdi.com
Whole thread Raw
In response to Re: "xmin" system column  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: "xmin" system column
Re: "xmin" system column
List pgsql-general
On Jan 26, 2006, at 4:44 PM, Tom Lane wrote:

> "Eric B. Ridge" <ebr@tcdi.com> writes:
>> Outside of "VACUUM FREEZE", is there any way the "xmin" column in a
>> relation can change, assuming of course the tuple is never updated
>> again?
>
> If the tuple lives long enough, VACUUM will change it to
> FrozenTransactionId
> eventually, even without the FREEZE option.

That's what I was afraid of.  I've pondering making a "grouping"
column that gets set to "xmin" via an UPDATE trigger.  At least I'd
have a constant value that would survive database dumps and reloads.

> This seems OK as long as the transaction was fairly recent.  Note that
> you will need a fairly restrictive definition of "same transaction"
> (no subtransactions).

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.

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

eric


pgsql-general by date:

Previous
From: Chris Browne
Date:
Subject: Re: VACUUM Question
Next
From: "Eric B. Ridge"
Date:
Subject: Re: "xmin" system column