Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tz7IX-00FHks-Jd for pgsql-general@arkaria.postgresql.org; Mon, 31 Mar 2025 05:02:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tz7IU-000Di2-OP for pgsql-general@arkaria.postgresql.org; Mon, 31 Mar 2025 05:02:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tz7IU-000Dht-DM for pgsql-general@lists.postgresql.org; Mon, 31 Mar 2025 05:02:54 +0000 Received: from smtp107.ord1d.emailsrvr.com ([184.106.54.107]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tz7IR-002ASv-2h for pgsql-general@lists.postgresql.org; Mon, 31 Mar 2025 05:02:53 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp22.relay.ord1d.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 4B992E00B7; Mon, 31 Mar 2025 01:02:49 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: SQL Server's WITH (NOLOCK) equivalent in PostgreSQL? From: Christophe Pettus In-Reply-To: Date: Sun, 30 Mar 2025 22:02:18 -0700 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: =?utf-8?B?7J207ZiE7KeE?= X-Mailer: Apple Mail (2.3776.700.51.11.1) X-Classification-ID: ffc07365-e287-4f5a-9b0a-2329ba2787fb-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Mar 30, 2025, at 21:44, =EC=9D=B4=ED=98=84=EC=A7=84 = wrote: > Since PostgreSQL uses MVCC, I'm wondering what the best practice is = for non-blocking reads,=20 > and whether there's an equivalent to dirty reads or READ UNCOMMITTED. There are two different questions here. 1. Reads are not blocked in PostgreSQL by writers, even if another = transaction has updated the row but not yet committed. 2. There is no equivalent of a dirty read in PostgreSQL. You can only = read committed data (short of bypassing the database and reading the = disk directly).=