doc: clarify text around MVCC example query

Reported-by: marlene.brandstaetter@cargonet.software

Discussion: https://postgr.es/m/167765529052.987840.12345375075704447735@wrigleys.postgresql.org

Backpatch-through: master
pull/182/head
Bruce Momjian 11 months ago
parent 4a9effe45e
commit 2fa255ce9b
  1. 8
      doc/src/sgml/mvcc.sgml

@ -417,8 +417,8 @@
does not see effects of those commands on other rows in the database. does not see effects of those commands on other rows in the database.
This behavior makes Read Committed mode unsuitable for commands that This behavior makes Read Committed mode unsuitable for commands that
involve complex search conditions; however, it is just right for simpler involve complex search conditions; however, it is just right for simpler
cases. For example, consider updating bank balances with transactions cases. For example, consider transferring $100 from one account
like: to another:
<screen> <screen>
BEGIN; BEGIN;
@ -427,8 +427,8 @@ UPDATE accounts SET balance = balance - 100.00 WHERE acctnum = 7534;
COMMIT; COMMIT;
</screen> </screen>
If two such transactions concurrently try to change the balance of account If another transactions concurrently tries to change the balance of account
12345, we clearly want the second transaction to start with the updated 7534, we clearly want the second statement to start with the updated
version of the account's row. Because each command is affecting only a version of the account's row. Because each command is affecting only a
predetermined row, letting it see the updated version of the row does predetermined row, letting it see the updated version of the row does
not create any troublesome inconsistency. not create any troublesome inconsistency.

Loading…
Cancel
Save