Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 024BF2E35DA for ; Wed, 28 Nov 2007 18:08:29 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 66184-09 for ; Wed, 28 Nov 2007 18:08:21 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E980F2E00EF for ; Wed, 28 Nov 2007 18:08:25 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lASM8Ouk024729; Wed, 28 Nov 2007 17:08:24 -0500 (EST) To: "Daniel Caune" cc: pgsql-sql@postgresql.org Subject: Re: Strang behaviour SELECT ... LIMIT n FOR UPDATE In-reply-to: <1E293D3FF63A3740B10AD5AAD88535D2068A695E@UBIMAIL1.ubisoft.org> References: <1E293D3FF63A3740B10AD5AAD88535D2068A695E@UBIMAIL1.ubisoft.org> Comments: In-reply-to "Daniel Caune" message dated "Wed, 28 Nov 2007 16:28:47 -0500" Date: Wed, 28 Nov 2007 17:08:24 -0500 Message-ID: <24728.1196287704@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/148 X-Sequence-Number: 29676 "Daniel Caune" writes: > It seems that, in certain condition, row (199,84) is shadowing row > (3702,85); This would be the expected behavior if row (199,84) were an updated version of row (3702,85), but you couldn't see it yet in your current transaction snapshot. A plain SELECT would show the older version (the current one according to the snapshot) while SELECT FOR UPDATE would show the newest committed version. I think you must have somehow got a corrupt-data situation with respect to the commit status of these rows, but it's not real clear how. Would you show us the xmin and xmax of the rows, and also the current transaction counter? (pg_controldata will give you a close-enough idea of the latter.) regards, tom lane