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 1syTcE-000Ap5-9X for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2024 10:08:23 +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 1syTbE-000NUg-NF for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2024 10:07:21 +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 1syTbE-000NUA-BD for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2024 10:07:20 +0000 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1syTbB-0000hO-RD for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2024 10:07:19 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1728468433; cv=none; d=zohomail.com; s=zohoarc; b=BUIQNbL1A62MNz7JujLfa+TyucZNqZEP2ctvnNIKPZLL+NZzLYWYWhF9VTpiYMN+up17ML1yluVc6YyeTN0dU1WQ04fXwet6KJ/OD1xd9wpLo0sxcDu2twK+3t7bjdMm0wHhTAR7GYdyH7WUgJsCCazvkHUNE6aj32dgWAnZVSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728468433; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=2t9kyMHWujT/5s2lWiwqYFFoDcLH1MqUi0fFU+KaE14=; b=TLdrTzHd9e7OFY/POCYh4GwE1Yev/31Rs9ggupxSNv8hT/rvk9agF0Z1CNGdz2FIv4V9a5LTQ5jQZUUgNEWY+mxcPfRAgEyVeZZL9XH+PahnbVqd/Ix4K5Nxxd2RDDy66SXgdmzlYR/OwhQwrL/XaYzPWZ+9ectyaAIGI74jrJo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=iseki.space; spf=pass smtp.mailfrom=admin@iseki.space; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1728468433; s=zoho; d=iseki.space; i=admin@iseki.space; h=Message-ID:Date:Date:MIME-Version:To:To:From:From:Subject:Subject:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=2t9kyMHWujT/5s2lWiwqYFFoDcLH1MqUi0fFU+KaE14=; b=aAJCdzw/Z8B8QnFfLj/3JrJjZq0+APjDmALztK/No3P+T5jDHoHybftOdcdtl+6N XDKSTsWrWiRTkYb5E8KWChm2D8CAVOYG7oF3YqywIo0LnRkNDix963xTiY1oeAlgg7g Rq0ngnq46B7FzM0zR7dkxvG4oyRE1NLJE7HiegfY= Received: by mx.zohomail.com with SMTPS id 172846843130211.641963691427804; Wed, 9 Oct 2024 03:07:11 -0700 (PDT) Message-ID: <7901c7e4-69c6-4bb2-8e9d-ad556d493717@iseki.space> Date: Wed, 9 Oct 2024 18:07:09 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: pgsql-general@lists.postgresql.org From: iseki zero Subject: Questions about document "Concurrenry control" section Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ZohoMailClient: External List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I found it difficult to understanding some paragraph in the document "Concurrency control" section. > The Repeatable Read mode provides a rigorous guarantee that each transaction sees a completely stable view of the database. However, this view will not necessarily always be consistent with some serial (one at a time) execution of concurrent transactions of the same level. For example, even a read-only transaction at this level may see a control record updated to show that a batch has been completed but/not/see one of the detail records which is logically part of the batch because it read an earlier revision of the control record. Attempts to enforce business rules by transactions running at this isolation level are not likely to work correctly without careful use of explicit locks to block conflicting transactions. At: https://www.postgresql.org/docs/17/transaction-iso.html#XACT-REPEATABLE-READ:~:text=The%20Repeatable%20Read%20mode,to%20block%20conflicting%20transactions. Specifically, I can't understand the example. Why in an earlier revision, the control record show that the batch has been completed? In my recognization, the control record state transation should be "running" -> "completed". And only after all batch operation completed then the control record will be changed to "completed". The another big problem is, I interpret the whole batch operation is in one transaction. So, we can read updates from another uncommited yet transaction?? I read the front paragraph(Read Committed), the locking behaviour will effect the read view, and I understand the behaviour might still be exists in Repeatable Read. But the example said, read-only transaction. Thank you iseki zero