Re: Unclear\mistakable description of UPDATE behaviour in "13.2.1. Read Committed Isolation Level"

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: radiodiversion(at)gmail(dot)com, Pg Docs <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Unclear\mistakable description of UPDATE behaviour in "13.2.1. Read Committed Isolation Level"
Date: 2021-08-17 23:03:24
Message-ID: CAKFQuwYyZr0X8dPbknf5CDFW4-YVvH19QEXbUAGuxzRNMKnOAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Tue, Aug 17, 2021 at 3:56 PM PG Doc comments form <noreply(at)postgresql(dot)org>
wrote:

>
> "UPDATE, DELETE, SELECT FOR UPDATE, and SELECT FOR SHARE commands ...
> ...If the first updater commits, the second updater will ignore the row if
> the first updater deleted it, otherwise it will attempt to apply its
> operation to the updated version of the row. The search condition of the
> command (the WHERE clause) is re-evaluated to see if the updated version of
> the row still matches the search condition."
>
> described in documentation ("The search condition of the command (the WHERE
> clause) is re-evaluated")
>
>
Maybe the nuance was lost and the docs could be improved, but it clearly
says "...to see if the updated version of the rows STILL MATCHES the search
condition" - i.e., it will happily skip a row it thought, before it started
waiting, that it was going to have to update but it will not go looking for
new rows that now may match the criteria. It also won't handle any inserts
by the same reasoning. This is reinforced by the leading sentence:

"...they will only find target rows that were committed as of the command
start time."

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message radiodiversion 2021-08-17 23:17:47 Re: Unclear\mistakable description of UPDATE behaviour in "13.2.1. Read Committed Isolation Level"
Previous Message PG Doc comments form 2021-08-17 22:32:42 Unclear\mistakable description of UPDATE behaviour in "13.2.1. Read Committed Isolation Level"