Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntVoa-00050Y-IQ for pgsql-general@arkaria.postgresql.org; Tue, 24 May 2022 14:47:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ntVoZ-0004Fd-EP for pgsql-general@arkaria.postgresql.org; Tue, 24 May 2022 14:47:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntVoZ-0004Ea-3i for pgsql-general@lists.postgresql.org; Tue, 24 May 2022 14:47:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntVoX-00010o-5z for pgsql-general@lists.postgresql.org; Tue, 24 May 2022 14:47:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 24OElB1x1544723; Tue, 24 May 2022 10:47:11 -0400 From: Tom Lane To: Matthias Apitz cc: pgsql-general@lists.postgresql.org Subject: Re: existing row not found by SELECT ... WHERE CTID = ? In-reply-to: References: Comments: In-reply-to Matthias Apitz message dated "Tue, 24 May 2022 16:44:15 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1544721.1653403631.1@sss.pgh.pa.us> Date: Tue, 24 May 2022 10:47:11 -0400 Message-ID: <1544722.1653403631@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Matthias Apitz writes: > We have a C-written program, written in ESQL/C, of our LMS where the logic > crawls with FETCH through a hit list and does UPDATE on some rows which > match certain condition. This works fine for thousands of rows every night, > but magically sometimes it fails. Maybe something else already updated the row since the cursor was opened? That would change its CTID. regards, tom lane