Re: "xmin" system column

From: Marko Kreen <markokr(at)gmail(dot)com>
To: "Eric B(dot) Ridge" <ebr(at)tcdi(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: "xmin" system column
Date: 2006-01-27 08:36:33
Message-ID: e51f66da0601270036y2f4c7413x44313b3d73c03c5d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/26/06, Eric B. Ridge <ebr(at)tcdi(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pedro Monjo Florit 2006-01-27 09:10:49 Change SERIAL to INTEGER
Previous Message Robert Korteweg 2006-01-27 08:32:44 Re: Missing database entry in pg_database