From 26f1202ca318459753a39b2ced5cb6ea9cd8ab8d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 26 Aug 2005 20:07:17 +0000 Subject: 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 7.3 branch. --- src/backend/utils/time/tqual.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/backend/utils/time') diff --git a/src/backend/utils/time/tqual.c b/src/backend/utils/time/tqual.c index fb9323d9e86..25e7af0872f 100644 --- a/src/backend/utils/time/tqual.c +++ b/src/backend/utils/time/tqual.c @@ -30,7 +30,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.61.2.1 2005/05/07 21:23:24 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.61.2.2 2005/08/26 20:07:17 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -931,10 +931,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)) -- cgit v1.2.3