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 1stZzS-00HWpy-0S for pgsql-general@arkaria.postgresql.org; Wed, 25 Sep 2024 21:56:06 +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 1stZzR-00F1VI-BU for pgsql-general@arkaria.postgresql.org; Wed, 25 Sep 2024 21:56:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1stZzR-00F1Sq-0h for pgsql-general@lists.postgresql.org; Wed, 25 Sep 2024 21:56:05 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1stZzL-0013aH-17 for pgsql-general@lists.postgresql.org; Wed, 25 Sep 2024 21:56:03 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id E0A981EE03; Wed, 25 Sep 2024 23:55:54 +0200 (CEST) Date: Wed, 25 Sep 2024 23:55:54 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Repeatable Read Isolation Level "transaction start time" Message-ID: <20240925215554.gfg24h5sp5aqesxv@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <9CEBFAC7-4372-4FF0-8124-FFFE834B03C6@gmail.com> <3346993.1727188126@sss.pgh.pa.us> <28109.1727286817@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mpjhcbvh3jkk5tdw" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mpjhcbvh3jkk5tdw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024-09-25 13:53:30 -0700, Christophe Pettus wrote: > > On Sep 25, 2024, at 13:49, Greg Sabino Mullane wro= te: > > BEGIN ISOLATION MODE REPEATABLE READ SNAPSHOT NOW; >=20 > This might well be a failure of imagination on my part, but when would > it pragmatically matter that the snapshot is taken at the first > statement as opposed to at BEGIN? It may make a difference if you're comparing timestamps. For example, if you're using isolation level REPEATABLE READ and (mistakenly) assume that the snapshot is taken at BEGIN, you would expect any transaction_timestamp() written by a different transaction and readable by this transaction to be earlier than the transaction_timestamp() of this transaction. But that's wrong because the other transaction could have happened entirely in the time between your BEGIN and the statement which actually triggers the snapshot. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --mpjhcbvh3jkk5tdw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmb0huQACgkQ8g5IURL+ KF2PQRAAoAMtY15IomsbNVrylBU9Pzxb6FlAQpFnM2P1sFjNw5Lm3hTmicTZcR2m AcE4VDpjm0y8RHss8xA5ay9dx/DcHgAPwPONbeMJATYT8wDI8Gef9w7SjJ9nRCU9 84BehnFVjaKZOJf1II8fHRYeulm0PtFHDPgjSAbAHbLTfemqbdr0ICPVZ0nY79y1 H5HRdVqKcI5CeLNL7N3KRzscs9Px5/n2cqbK91xTpk+2zfZVcaClZjMtRJdc5X1R Da/dfROuNnSzL4atla1Jz2VfSRAJh3Z/wrYXiJj67wdyy8XsmBQVWq7gMpd07lz3 J6r14D4HHxsaEPK8Qm05Kxxo3KNhaS7Ac4jdyoNoGWriAXiH1H66b/DsfP20xO0f jEN7hhK2chJeoV9GVVrBTJxt8yUVwviFphVoTRCzCKKqeFpXGHaLd0aGhfTQZXji rJ96d8+MWWVkZQBiQkIhmxF6v9Gm8p3chbfFUu280XQAGR1JHMQ6Y+e5Vs7MEE8Z aGpvEE6smys5sYodcchWx1x/zsucMGwrPMJ+mcGVKEkAu8mUrz994ij9Enac9A6j xFOuls2MJPQSmNGLdX7qfG4v0761t75+1Q8ahHxZL9DQfmlkS/HSqawnqs8rrU7c Qr8Bog4yavLnB2rO4LgSLfuPi+9F4j+FjlI3/LZOjv+LGywq1RY= =Bebd -----END PGP SIGNATURE----- --mpjhcbvh3jkk5tdw--