Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YrqsD-0002IF-WC for pgsql-hackers@arkaria.postgresql.org; Mon, 11 May 2015 16:48:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YrqsC-0004UZ-RH for pgsql-hackers@arkaria.postgresql.org; Mon, 11 May 2015 16:48:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YrqsB-0004UO-EL; Mon, 11 May 2015 16:48:07 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Yrqs7-0005W0-Hg; Mon, 11 May 2015 16:48:06 +0000 Received: from intern.anarazel.de (unknown [184.23.178.130]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id C7DF7860001; Mon, 11 May 2015 18:48:01 +0200 (CEST) Date: Mon, 11 May 2015 18:47:59 +0200 From: Andres Freund To: Tom Lane , Peter Geoghegan Cc: postgresql2@realityexists.net, pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [BUGS] BUG #13148: Unexpected deferred EXCLUDE constraint violation on derived table Message-ID: <20150511164759.GQ12950@alap3.anarazel.de> References: <20150424165722.2548.62492@wrigleys.postgresql.org> <30055.1431288113@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30055.1431288113@sss.pgh.pa.us> X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi, On 2015-05-10 16:01:53 -0400, 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. Heh, it's curious that this wasn't found up until now. I also wonder if this might be related to the spurious violations Peter G. has been observing... > 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. Looks good to me. Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers