aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-08-25 19:45:06 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-08-25 19:45:06 +0000
commit08e12b89d5e094315f2b5d238916b2f56ad8ad7a (patch)
tree83461a63669fe228bebaaa2722ab281e0d2da58f /src/backend/utils
parent5576a611cd8f358a751f53ad787b4b659bbf77cc (diff)
downloadpostgresql-08e12b89d5e094315f2b5d238916b2f56ad8ad7a.tar.gz
postgresql-08e12b89d5e094315f2b5d238916b2f56ad8ad7a.zip
Back-patch fixes for problems with VACUUM destroying t_ctid chains too soon,
and with insufficient paranoia in code that follows t_ctid links. This patch covers the 8.0 branch.
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/time/tqual.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/utils/time/tqual.c b/src/backend/utils/time/tqual.c
index ef158d97bc3..eda347e2750 100644
--- a/src/backend/utils/time/tqual.c
+++ b/src/backend/utils/time/tqual.c
@@ -32,7 +32,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/time/tqual.c,v 1.81.4.1 2005/05/07 21:22:36 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/time/tqual.c,v 1.81.4.2 2005/08/25 19:45:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1137,10 +1137,13 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin,
HeapTupleHeaderGetXmax(tuple)))
{
/*
- * inserter also deleted it, so it was never visible to anyone
- * else
+ * Inserter also deleted it, so it was never visible to anyone
+ * else. However, we can only remove it early if it's not an
+ * updated tuple; else its parent tuple is linking to it via t_ctid,
+ * and this tuple mustn't go away before the parent does.
*/
- return HEAPTUPLE_DEAD;
+ if (!(tuple->t_infomask & HEAP_UPDATED))
+ return HEAPTUPLE_DEAD;
}
if (!TransactionIdPrecedes(HeapTupleHeaderGetXmax(tuple), OldestXmin))