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 1qBwHa-0007sj-5e for pgsql-docs@arkaria.postgresql.org; Wed, 21 Jun 2023 11:45:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qBwHZ-0007Vv-2o for pgsql-docs@arkaria.postgresql.org; Wed, 21 Jun 2023 11:45:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBwHY-0007Ta-RR for pgsql-docs@lists.postgresql.org; Wed, 21 Jun 2023 11:45:52 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qBwHS-003QDd-W3 for pgsql-docs@lists.postgresql.org; Wed, 21 Jun 2023 11:45:51 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-51bdd6f187fso761019a12.1 for ; Wed, 21 Jun 2023 04:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1687347945; x=1689939945; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=DNZ+v3npyjqhtcjZZ08oNbSyfhUN5CcNNxa0yBUf548=; b=rew6fswoKBsY0Wuy5HWv264tzMBPOfKbrBcb+ssvIOZfWvk+QgpHJifIc/RpbAUSk3 kckE/rbDjOPBbwaIhD6A4j/iC0ZbgrpYCv0WmLU+WD+u0YIqS6wSUQK6Whd3VrYNaWt7 fsLVbpDRtFFFE1cDu4rHv9m/+7BTN40lB+xL3k5NGn90wsNA3PuHy5oujOuwk+hchFtA FZ7dPlM/GmchkNn10zXJcj8F09Z/GVp9CwKjxDGeCnrhJZNJEOwN2CDPC2IaFuKNW0Go Aaw0XdyeEyDLqsIV51OtR90z18z/Nc/6rhcut6HYCWE5yxL1vWllRFqvSZBzlaqfbISm U/uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687347945; x=1689939945; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DNZ+v3npyjqhtcjZZ08oNbSyfhUN5CcNNxa0yBUf548=; b=Lx8oSCK5qq9Y+5I7Bs6m20kTND2josP53cOL/0dqEmHxTjiah0RCdZ/EnBOIRj5z3B Lr7/9f8DKJYYwouCoOnJMQEiph96VJL24JnYj4pIULKxXuxLM8TUmEkBVn1KtTS2ZxNI DuwyKxDcmLNCDJdzyBjmo/X/t17EEdYHX3lUr9heP5Kp80V72H37Bg/0PVKLiCMckP75 2mJktJBK+kceGvz7UGmCWu82vBfrnVKWJ4VDAY9BK8wK/u5FNeuGEQhMufTV8iaW45u0 M+1SO9jtYKwaa3WwN61iFGtZz89zgv4w4D4ICeVqkkplha0UbgHsJXFPZPoQW/os+qIg 4jwg== X-Gm-Message-State: AC+VfDycUKAKm8wvQSXoO8CS+90WP9H6gcQdIsMGhePHqudQAhwvkgFw eRC9/AWfJAhcGsC1QtxbRX/L2g== X-Google-Smtp-Source: ACHHUZ5A/eug0D7dBigEQwQWKpla9SiDwOzyuFklfsXrLGJe2+xHNvAac1FcFcTIr9/L2FxDVKqA2g== X-Received: by 2002:a05:6402:5186:b0:51a:5ad9:5851 with SMTP id q6-20020a056402518600b0051a5ad95851mr8082483edd.3.1687347945268; Wed, 21 Jun 2023 04:45:45 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:3a4d:f2a0:fef3:7aeb:6c99]) by smtp.gmail.com with ESMTPSA id q12-20020a056402032c00b0051a2c7f5b0fsm2542070edw.88.2023.06.21.04.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 04:45:44 -0700 (PDT) Message-ID: <2ede679a79a55f62450bcc7bc7893730c3a2e5ed.camel@cybertec.at> Subject: Re: [PATCH] Attempt to clarify example of serialization anomaly From: Laurenz Albe To: Will Mortensen , pgsql-docs@lists.postgresql.org Date: Wed, 21 Jun 2023 13:45:44 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2023-06-20 at 20:01 -0700, Will Mortensen wrote: > Rebased on master and updated the wording in several places. All > feedback is appreciated. :-) >=20 > I now see how to link to the wiki from the docs. I guess I numbered > the transactions differently than the wiki's version though; I can > rework it to more closely match the wiki if linking seems > desirable. I agree that the current wording in the documentation is too terse, so your patch is an improvement. There is still the potential for confusion. Perhaps an example with explicit SQL statements (as in the other sections) might be even better. Perhaps something simple like If two concurrent sessions run: BEGIN ISOLATION LEVEL REPEATABLE READ; SELECT count(*) FROM tab WHERE name =3D 'alice'; /* if the result is <> 0, rollback */ INSERT INTO table (name) VALUES ('alice'); COMMIT; you could end up with two rows with the same name, which could not happen in a serial execution of the transactions. Yours, Laurenz Albe