]> granicus.if.org Git - postgresql/commit
Fix incorrect checking of deferred exclusion constraint after a HOT update.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 May 2015 16:25:28 +0000 (12:25 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 May 2015 16:25:28 +0000 (12:25 -0400)
commitb93c8eaf8c35485175358c552cd5adce0e197ec9
tree24c0f783f1baa335746d346a7f62a8f3abf8c3fb
parentc981e599916c828fe3fe2e7c3cf92949f81ebcd3
Fix incorrect checking of deferred exclusion constraint after a HOT update.

If a row that potentially violates a deferred exclusion constraint is
HOT-updated later in the same transaction, the exclusion constraint would
be reported as violated when the check finally occurs, even if the row(s)
the new row originally conflicted with have since been removed.  This
happened because the wrong TID was passed to check_exclusion_constraint(),
causing the live HOT-updated row to be seen as a conflicting row rather
than recognized as the row-under-test.

Per bug #13148 from Evan Martin.  It's been broken since exclusion
constraints were invented, so back-patch to all supported branches.
src/backend/commands/constraint.c
src/test/regress/input/constraints.source
src/test/regress/output/constraints.source