pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@heroku.com>
Cc: postgresql2@realityexists.net
Cc: pgsql-bugs@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [BUGS] BUG #13148: Unexpected deferred EXCLUDE constraint violation on derived table
Date: Mon, 11 May 2015 18:47:59 +0200
Message-ID: <20150511164759.GQ12950@alap3.anarazel.de> (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-hackers>

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



view thread (11+ messages)  latest in thread

Message-ID: <20150511164759.GQ12950@alap3.anarazel.de>
Permalink:  ../20150511164759.GQ12950@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20150511164759.GQ12950@alap3.anarazel.de

 · 

reply

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: andres@anarazel.de, tgl@sss.pgh.pa.us, pg@heroku.com, postgresql2@realityexists.net, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] BUG #13148: Unexpected deferred EXCLUDE constraint violation on derived table
  In-Reply-To: <20150511164759.GQ12950@alap3.anarazel.de>
  References: <20150424165722.2548.62492@wrigleys.postgresql.org> <30055.1431288113@sss.pgh.pa.us> <20150511164759.GQ12950@alap3.anarazel.de>

* 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