Thread: pgsql: Have CLUSTER advance the table's relfrozenxid.

pgsql: Have CLUSTER advance the table's relfrozenxid.

From
alvherre@postgresql.org (Alvaro Herrera)
Date:
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)