Re: XMAX weirdness (was: Plans for solving the VACUUM problem)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: XMAX weirdness (was: Plans for solving the VACUUM problem)
Date: 2001-05-23 19:12:14
Message-ID: 16444.990645134@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(at)tm(dot)ee> writes:
> but then no xmax should ever be visible in a regular query :

Not so. For example, if a transaction tried to delete a tuple, but is
either still open or rolled back, then other transactions would see its
XID in the tuple's xmax. Also, SELECT FOR UPDATE uses xmax to record
the XID of the transaction that has the tuple locked --- that's the
case you are seeing, because of the SELECT FOR UPDATE done by the
foreign-key triggers on the table.

There is a claim in the current documentation that xmax is never nonzero
in a visible tuple, but that's incorrect ...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-05-23 19:31:10 Re: Plans for solving the VACUUM problem
Previous Message Peter Eisentraut 2001-05-23 18:12:36 Re: Not released yet, but could someone take a quick peak ...