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 1ntq7K-0003NJ-Jr for pgsql-general@arkaria.postgresql.org; Wed, 25 May 2022 12:27:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ntq7I-0002fl-Gl for pgsql-general@arkaria.postgresql.org; Wed, 25 May 2022 12:27:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntq7I-0002fc-14 for pgsql-general@lists.postgresql.org; Wed, 25 May 2022 12:27:56 +0000 Received: from smtp.burggraben.net ([88.198.69.140]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntq7F-0007n4-Dz for pgsql-general@lists.postgresql.org; Wed, 25 May 2022 12:27:54 +0000 Received: from elch.exwg.net (elch.exwg.net [IPv6:2001:470:7120:1:127b:44ff:fe4f:148d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "elch.exwg.net", Issuer "R3" (not verified)) by smtp.burggraben.net (Postfix) with ESMTPS id 1C920C00317; Wed, 25 May 2022 14:27:51 +0200 (CEST) Received: by elch.exwg.net (Postfix, from userid 1000) id 801E73AB09; Wed, 25 May 2022 14:27:50 +0200 (CEST) Date: Wed, 25 May 2022 14:27:50 +0200 From: Christoph Moench-Tegeder To: Matthias Apitz Cc: Laurenz Albe , Tom Lane , pgsql-general@lists.postgresql.org Subject: Re: existing row not found by SELECT ... WHERE CTID = ? Message-ID: References: <1652228.1653408709@sss.pgh.pa.us> <20220525120112.GA17@sh4-5.1blu.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220525120112.GA17@sh4-5.1blu.de> User-Agent: Mutt/2.2.5 (2022-05-16) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ## Matthias Apitz (guru@unixarea.de): > We will solve the problem now with setting the session after connect to > > SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL REPEATABLE READ; > > (with an appropriate ESQL/C call). Any comments? Maybe the real question is whether it is wise to use an implementation artifact (ctid) to identify rows? The textbook approach could be row locks (SELECT ... FOR SHARE/UPDATE and variants) to prevent concurrent changes or optimistic locking (and a primary key in any case) - but maybe you already investigated those options? Regards, Christoph -- Spare Space