pgsql: Have CLUSTER advance the table's relfrozenxid.

From: alvherre(at)postgresql(dot)org (Alvaro Herrera)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Have CLUSTER advance the table's relfrozenxid.
Date: 2007-05-18 23:19:42
Message-ID: 20070518231942.30A0F9FB6EA@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Have CLUSTER advance the table's relfrozenxid. The new frozen point is the
FreezeXid introduced in a recent commit, so there isn't any data loss in this
approach.

Doing it causes ALTER TABLE (or rather, the forms of it that cause a full table
rewrite) to be affected as well. In this case, the frozen point is RecentXmin,
because after the rewrite all the tuples are relabeled with the rewriting
transaction's Xid.

TOAST tables are fixed automatically as well, as fallout of the way they were
already being handled in the respective code paths.

With this patch, there is no longer need to VACUUM tables for Xid wraparound
purposes that have been cleaned up via TRUNCATE or CLUSTER.

Modified Files:
--------------
pgsql/src/backend/commands:
cluster.c (r1.160 -> r1.161)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/cluster.c.diff?r1=1.160&r2=1.161)
tablecmds.c (r1.224 -> r1.225)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c.diff?r1=1.224&r2=1.225)
pgsql/src/include/commands:
cluster.h (r1.32 -> r1.33)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/commands/cluster.h.diff?r1=1.32&r2=1.33)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2007-05-19 01:02:34 pgsql: Fix dumb compile error in the last patch.
Previous Message Peter Eisentraut 2007-05-18 15:55:03 pgsql: Mark some intermediate targets as .PRECIOUS, to replace the