Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id CBF7F9FB399 for ; Mon, 29 Jan 2007 11:36:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 81949-07 for ; Mon, 29 Jan 2007 11:35:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id CAE2F9FB396 for ; Mon, 29 Jan 2007 11:35:56 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l0TFZrdj010669; Mon, 29 Jan 2007 10:35:53 -0500 (EST) To: arnaulist@andromeiberica.com cc: "pgsql-admin@postgresql.org" Subject: Re: Very strange postgresql behaviour In-reply-to: <45BDE670.8010607@andromeiberica.com> References: <45BDE670.8010607@andromeiberica.com> Comments: In-reply-to Arnau message dated "Mon, 29 Jan 2007 13:20:00 +0100" Date: Mon, 29 Jan 2007 10:35:53 -0500 Message-ID: <10668.1170084953@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/262 X-Sequence-Number: 24418 Arnau writes: > I have postgresql 7.4.2 running on debian and I have the oddest > postgresql behaviour I've ever seen. Is this specific to these two rows? If so it might be a case of this bug, which was repaired in 7.4.13: http://archives.postgresql.org/pgsql-general/2006-05/msg00756.php http://archives.postgresql.org/pgsql-committers/2006-05/msg00174.php 2006-05-19 12:31 tgl * src/backend/executor/nodeIndexscan.c (REL7_4_STABLE): Fix nasty bug in nodeIndexscan.c's detection of duplicate tuples during a multiple (OR'ed) indexscan. It was checking for duplicate tuple->t_data->t_ctid, when what it should be checking is tuple->t_self. The trouble situation occurs when a live tuple has t_ctid not pointing to itself, which can happen if an attempted UPDATE was rolled back. After a VACUUM, an unrelated tuple could be installed where the failed update tuple was, leading to one live tuple's t_ctid pointing to an unrelated tuple. If one of these tuples is fetched by an earlier OR'ed indexscan and the other by a later indexscan, nodeIndexscan.c would incorrectly ignore the second tuple. The bug exists in all 7.4.* and 8.0.* versions, but not in earlier or later branches because this code was only used in those releases. Per trouble report from Rafael Martinez Guerrero. REINDEX wouldn't fix this, although a table dump and reload would. regards, tom lane PS: please don't spam multiple lists with the same question.