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 1jS0zG-0006sE-CJ for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Apr 2020 16:15:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jS0zF-0007OS-2F for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Apr 2020 16:15:33 +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 1jS0zE-0007OL-SH for pgsql-bugs@lists.postgresql.org; Fri, 24 Apr 2020 16:15:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jS0zC-0002D6-6M for pgsql-bugs@lists.postgresql.org; Fri, 24 Apr 2020 16:15:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 03OGFSBq004392; Fri, 24 Apr 2020 12:15:28 -0400 From: Tom Lane To: =?UTF-8?Q?Eudald_Valc=C3=A0rcel_Lacasa?= cc: pgsql-bugs@lists.postgresql.org Subject: Re: Queries getting older values (autocommit enabled) In-reply-to: References: Comments: In-reply-to =?UTF-8?Q?Eudald_Valc=C3=A0rcel_Lacasa?= message dated "Fri, 24 Apr 2020 18:03:42 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4390.1587744928.1@sss.pgh.pa.us> Date: Fri, 24 Apr 2020 12:15:28 -0400 Message-ID: <4391.1587744928@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?UTF-8?Q?Eudald_Valc=C3=A0rcel_Lacasa?= writes: > Could it be possible that, somehow, the select query starts before the > update one, although it's printed as if it's being executed after it? It's certainly possible that the select is using a snapshot that was taken before the update commits. You should read this chapter of the manual for background and some hints: https://www.postgresql.org/docs/current/mvcc.html regards, tom lane