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 1nuFwj-000126-1R for pgsql-general@arkaria.postgresql.org; Thu, 26 May 2022 16:02:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nuFwh-0000sf-4k for pgsql-general@arkaria.postgresql.org; Thu, 26 May 2022 16:02:43 +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 1nuFwg-0000rM-Pa for pgsql-general@lists.postgresql.org; Thu, 26 May 2022 16:02:42 +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 1nuFwe-0000gz-Hh for pgsql-general@lists.postgresql.org; Thu, 26 May 2022 16:02:42 +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 24QG2ZmO2305903; Thu, 26 May 2022 12:02:35 -0400 From: Tom Lane To: "David G. Johnston" cc: Matthias Apitz , Laurenz Albe , "pgsql-general@lists.postgresql.org" Subject: Re: existing row not found by SELECT ... WHERE CTID = ? In-reply-to: References: <1652228.1653408709@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Thu, 26 May 2022 08:24:12 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2305901.1653580955.1@sss.pgh.pa.us> Date: Thu, 26 May 2022 12:02:35 -0400 Message-ID: <2305902.1653580955@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Thursday, May 26, 2022, Matthias Apitz wrote: >> Is there any way to get with the old CTID to the row, for example with >> the old CTID to the new one which the row now has after the update of the >> row? > No, there is no link between old and new in the main table. There is a forward link from the old CTID to the new, but we don't provide any user-accessible way to use it. I wonder though if the OP should be considering using SELECT FOR UPDATE in his cursor, so that it'd automatically chain up to the newest row version. regards, tom lane