From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Will Mortensen <will@extrahop.com>
To: pgsql-docs@lists.postgresql.org
Subject: Re: [PATCH] Attempt to clarify example of serialization anomaly
Date: Wed, 21 Jun 2023 13:45:44 +0200
Message-ID: <2ede679a79a55f62450bcc7bc7893730c3a2e5ed.camel@cybertec.at> (raw)
In-Reply-To: <CAMpnoC4ZN=ByNfEuEmao4+qapVFk_-vwsC3PAr-W1Fxb2RJ3SA@mail.gmail.com>
References: <CAMpnoC4x3ZbMC4eP6g10HJTuGDa_74fUpWao28+af-suN08rPg@mail.gmail.com>
<CAMpnoC4ZN=ByNfEuEmao4+qapVFk_-vwsC3PAr-W1Fxb2RJ3SA@mail.gmail.com>
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. :-)
>
> 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 = '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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: laurenz.albe@cybertec.at, will@extrahop.com, pgsql-docs@lists.postgresql.org
Subject: Re: [PATCH] Attempt to clarify example of serialization anomaly
In-Reply-To: <2ede679a79a55f62450bcc7bc7893730c3a2e5ed.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox