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

From Marko Kreen
Subject Re: "xmin" system column
Date
Msg-id e51f66da0601270036y2f4c7413x44313b3d73c03c5d@mail.gmail.com
Whole thread Raw
In response to "xmin" system column  ("Eric B. Ridge" <ebr@tcdi.com>)
List pgsql-general
On 1/26/06, Eric B. Ridge <ebr@tcdi.com> wrote:
> 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?  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.

I had the same problem - how to identify rows by transaction.  I solved
it by using the xxid from Slony-I and making it 8-byte.

http://gborg.postgresql.org/pipermail/slony1-general/2006-January/003668.html
http://gborg.postgresql.org/pipermail/slony1-general/2006-January/003685.html

It has only 2 slight gotchas:

- the function will fail if there are more than 2G tx'es between calls
- you need to bump epoch if you reload dump.

otherwise seems to work fine.

Btw it uses TopTransactionId, so subtransactions should not be problem.

--
marko

pgsql-general by date:

Previous
From: Robert Korteweg
Date:
Subject: Re: Missing database entry in pg_database
Next
From: Stephan Vollmer
Date:
Subject: Error: "could not read from statistics collector pipe"