From: Evan Martin <postgresql@realityexists.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13148: Unexpected deferred EXCLUDE constraint violation on derived table
Date: Sun, 17 May 2015 12:30:07 +0200
Message-ID: <55586DAF.5070303@realityexists.net> (raw)
In-Reply-To: <30055.1431288113@sss.pgh.pa.us>
References: <20150424165722.2548.62492@wrigleys.postgresql.org>
<30055.1431288113@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 10/05/2015 10:01 PM, Tom Lane wrote:
> The cause of the problem seems to be that the UPDATE performs a HOT update
> of the new tuple, leaving in this case a dead tuple at (0,2) that is HOT
> updated by (0,3). When unique_key_recheck() is invoked for (0,2), it
> believes, correctly, that it has to perform the recheck anyway ... but it
> tells check_exclusion_constraint that the check is being performed for
> (0,2). So the index search inside check_exclusion_constraint finds the
> live tuple at (0,3) and thinks that is a conflict.
>
> This is reproducible clear back to 9.0 where exclusion constraints were
> added.
>
> The easiest fix seems to be to pass the HOT child's TID instead of the
> TID we were called for. (Note that the other path, for a regular unique
> constraint, is correct as-is because the original TID is what the index
> will know about.)
>
> The attached patch seems to fix the problem without breaking any existing
> regression tests, but I wonder if anyone can see a hole in it.
>
> regards, tom lane
>
Thanks very much for fixing this! Now that you know the cause, could you
suggest any workaround?
Also, any idea when the fix will be released? Will it be in 9.3.7 or
9.4.2 or only in 9.5.0?
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: postgresql@realityexists.net, tgl@sss.pgh.pa.us
Subject: Re: BUG #13148: Unexpected deferred EXCLUDE constraint violation on derived table
In-Reply-To: <55586DAF.5070303@realityexists.net>
References: <20150424165722.2548.62492@wrigleys.postgresql.org> <30055.1431288113@sss.pgh.pa.us> <55586DAF.5070303@realityexists.net>
* 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