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

From Tom Lane
Subject Re: "xmin" system column
Date
Msg-id 24623.1138311889@sss.pgh.pa.us
Whole thread Raw
In response to "xmin" system column  ("Eric B. Ridge" <ebr@tcdi.com>)
Responses Re: "xmin" system column  ("Eric B. Ridge" <ebr@tcdi.com>)
List pgsql-general
"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.

> I'm considering using this as a way to identify all tuples
> modified in the same transaction (in an effort to group them
> together), and am wondering if there's any way tuples from different
> transactions could end up with the same xmin value.

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).

            regards, tom lane

pgsql-general by date:

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