Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ietHW-0006NW-9L for pgsql-docs@arkaria.postgresql.org; Wed, 11 Dec 2019 04:07:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ietHT-0007S5-6o for pgsql-docs@arkaria.postgresql.org; Wed, 11 Dec 2019 04:07:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ietHS-0007RP-L9 for pgsql-docs@lists.postgresql.org; Wed, 11 Dec 2019 04:07:18 +0000 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ietHL-0007Wh-ND for pgsql-docs@lists.postgresql.org; Wed, 11 Dec 2019 04:07:17 +0000 Received: by mail-oi1-x242.google.com with SMTP id x14so12018572oic.10 for ; Tue, 10 Dec 2019 20:07:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=0zkl/ogiktoEnfj3+RHdOKcaqK9s/NVLRCBK+lRj7S4=; b=pb/OOqB2bxT6eTu+bIjLbDaUJF+2qwRoih0Mc7GzbCS3VOFAqOkPXk2mWOOZLmf4hU k9e66gsVp4uSdMjQED7vf5HUOhSp8BeaQN0YMyJ8LJJ/Jx6QGVHNezpCSTylw5M9Iwy9 ZIs+cX6eIX4SO7oj43uJU+FOXrQxeFockUdlY3fO2B7BQkVFJgHUhOX56ajXsx8GKMYN j3KJ4McNcACmH3DytBaKOS3X2W9YcTWsAtzO9pOqbth2jSMn7YuzkPSOeDuI2aX41ej9 8NDYnUgL+Ud8gzDo4Qk68/5ZThPfnox/zRKMVyuvx3BpZpoF4pBtcl5f3IPaowm5sVR+ UPUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=0zkl/ogiktoEnfj3+RHdOKcaqK9s/NVLRCBK+lRj7S4=; b=mfdiYRW+uCpctoSP+zdCOl+D1b5KbYgj/TpwMjvYg568W9HcDsvmn0+8b6ynMR+w4X JtPXyt3ZUReVp7LOTcSgH+Imn1nZiP991K/YmtpoSRRbRXHtzyvC+Ay+7O4pIdfCoK9h EJtbvSObM8gjFWh0YUSJ7eTVkNrbaM7QMzf2M2465O8nIETMQDuqNATF/ua+v7Lnf6Te 4njOcWNKIbxOyiuAUVi5kG05WneL3M/KA+m6Tlwe9zEI0c3c4yR+RxeqNWS83OqbPBNj 0uCcDj8bnkyzdXuwq863aphVhVlr1rJNFXkl3wNLLFj4iimXxFASbxEey3Blwcx9DZSf Rd9Q== X-Gm-Message-State: APjAAAXRBqqOAYCOIb6t3ngh8TQHBDiI4hiP31Hw/MneC13yjakThESw xJ691OYKwEVw7/9ZvdLNs7P8fXzQgt/nt7aIUonJBAIu X-Google-Smtp-Source: APXvYqwMSGScMKPOv1lQ5q0WRsBPIazCMPoxTXvhHotmoNFcx7fN+Y+Ypr9gFGZ6nNHrZciprawOEkQFyZHfkXaB+24= X-Received: by 2002:aca:48d6:: with SMTP id v205mr1218599oia.10.1576037230608; Tue, 10 Dec 2019 20:07:10 -0800 (PST) MIME-Version: 1.0 References: <157601459454.18137.13976433380958895558@wrigleys.postgresql.org> In-Reply-To: <157601459454.18137.13976433380958895558@wrigleys.postgresql.org> From: Thomas Munro Date: Wed, 11 Dec 2019 17:06:33 +1300 Message-ID: Subject: Re: Serializable description seems misleading? To: ajantha_perera@yahoo.com, pgsql-docs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Dec 11, 2019 at 11:27 AM PG Doc comments form wrote: > Page: https://www.postgresql.org/docs/12/transaction-iso.html > Description: > > Let's say I have two transactions running in Serializable isolation: > T1: Reads a row > T2: Reads the same row > T1: Updates the row > T1: Commits > T2: Commits > > You will not get an error on the second commit. These appear to fit the > description of concurrent transactions, and running one before the other > would give different results in the reading of the row by T2, depending on > which transaction was executed first. So how does this square with the docs > that state "it monitors for conditions which could make execution of a > concurrent set of serializable transactions behave in a manner inconsistent > with all possible serial (one at a time) executions". It only has to be consistent with *one* serial ordering of the transactions to be allowed, not all serial orderings. In this case, the observed values and effects are consistent with T2 running before T1. > This seems quite misleading, but I understand there may just be an aspect of > this that I am not understanding. Do you think that wording could be improved?