]> granicus.if.org Git - postgresql/commit
Back-patch fcff8a575198478023ada8a48e13b50f70054766 as a bug fix.
authorKevin Grittner <kgrittn@postgresql.org>
Wed, 14 Dec 2016 01:08:09 +0000 (19:08 -0600)
committerKevin Grittner <kgrittn@postgresql.org>
Wed, 14 Dec 2016 01:08:09 +0000 (19:08 -0600)
commit60314e28eb02c82eb658aaf3c7fcf253004acbb4
treeef59488e956c7b9ad494f5fafb2746b93b0a7e14
parent2d48131ed1442f87e196dfe99e4904a69f1daed3
Back-patch fcff8a575198478023ada8a48e13b50f70054766 as a bug fix.

When there is both a serialization failure and a unique violation,
throw the former rather than the latter.  When initially pushed,
this was viewed as a feature to assist application framework
developers, so that they could more accurately determine when to
retry a failed transaction, but a test case presented by Ian
Jackson has shown that this patch can prevent serialization
anomalies in some cases where a unique violation is caught within a
subtransaction, the work of that subtransaction is discarded, and
no error is thrown.  That makes this a bug fix, so it is being
back-patched to all supported branches where it is not already
present (i.e., 9.2 to 9.5).

Discussion: https://postgr.es/m/1481307991-16971-1-git-send-email-ian.jackson@eu.citrix.com
Discussion: https://postgr.es/m/22607.56276.807567.924144@mariner.uk.xensource.com
doc/src/sgml/mvcc.sgml
src/backend/access/nbtree/nbtinsert.c
src/test/isolation/expected/read-write-unique-2.out [new file with mode: 0644]
src/test/isolation/expected/read-write-unique-3.out [new file with mode: 0644]
src/test/isolation/expected/read-write-unique-4.out [new file with mode: 0644]
src/test/isolation/expected/read-write-unique.out [new file with mode: 0644]
src/test/isolation/isolation_schedule
src/test/isolation/specs/read-write-unique-2.spec [new file with mode: 0644]
src/test/isolation/specs/read-write-unique-3.spec [new file with mode: 0644]
src/test/isolation/specs/read-write-unique-4.spec [new file with mode: 0644]
src/test/isolation/specs/read-write-unique.spec [new file with mode: 0644]