Have the rewriteheap code freeze old tuples. This is safe because it is only
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 16 May 2007 16:36:56 +0000 (16:36 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 16 May 2007 16:36:56 +0000 (16:36 +0000)
applied to live tuples older than a recent Xmin, not to tuples that may be part
of an update chain.  Those still keep their original markings.

This patch makes it possible for CLUSTER to advance relfrozenxid, thus avoiding
the need of vacuuming the table for Xid wraparound purposes.  That will be
patched separately.

Patch from Heikki Linnakangas.

src/backend/access/heap/rewriteheap.c

index b00bdbd376c35ceb5fe4f88b7a93b3748e928543..de757eaeb131ff4fd5f53413af97208ac5fb0ea4 100644 (file)
@@ -538,6 +538,8 @@ raw_heap_insert(RewriteState state, HeapTuple tup)
        OffsetNumber    newoff;
        HeapTuple               heaptup;
 
+       heap_freeze_tuple(tup->t_data, state->rs_oldest_xmin, InvalidBuffer);
+
        /*
         * If the new tuple is too big for storage or contains already toasted
         * out-of-line attributes from some other relation, invoke the toaster.