aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2007-05-16 16:36:56 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2007-05-16 16:36:56 +0000
commitdfed0012bc03c3cda94e75af54e9c774556c9787 (patch)
tree162d7cdb5627e529bee1d69d36bfefc16c8aff74
parentd365ce1f5c90278c577ffe52a80adebee9cb3c33 (diff)
downloadpostgresql-dfed0012bc03c3cda94e75af54e9c774556c9787.tar.gz
postgresql-dfed0012bc03c3cda94e75af54e9c774556c9787.zip
Have the rewriteheap code freeze old tuples. This is safe because it is only
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.
-rw-r--r--src/backend/access/heap/rewriteheap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 96d6d6f2c02..be389c647aa 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -96,7 +96,7 @@
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/heap/rewriteheap.c,v 1.3 2007/04/17 21:29:31 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/heap/rewriteheap.c,v 1.4 2007/05/16 16:36:56 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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.