Re: Moving ExecInsertIndexTuples and friends to new file - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Moving ExecInsertIndexTuples and friends to new file
Date
Msg-id CAM3SWZQN2M4nRSLm=0ic3nqK9dN3iSXResWH6sZSu5-PYgT5LQ@mail.gmail.com
Whole thread Raw
In response to Re: Moving ExecInsertIndexTuples and friends to new file  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
On Fri, Apr 24, 2015 at 6:38 AM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> I wrote a little overview text on how unique and exclusion constraints are
> enforced. Most of the information can be gleaned from comments elsewhere,
> but I think it's helpful to have it in one place. Makes it easier to compare
> how unique and exclusion constraints work. The harmless deadlocks with
> exclusion constraints are not explained elsewhere AFAICS.

FWIW, both Jeff Davis and Tom Lane were well aware of this issue back
when exclusion constraints went in - it was judged to be acceptable at
the time, which I agree with. I happened to discuss this with Jeff in
New York recently. I agree that it should definitely be documented
like this (and the fact that ordinary unique indexes are unaffected,
too).

> This is also in preparation for Peter's INSERT ON CONFLICT patch. That will
> add another section explaining how the deadlocks and livelocks are avoided.
> That's easier to understand after you grok the potential for deadlocks with
> exclusion constraints.

Makes sense.

> This also removes a comment from 1989 claiming that the code should be moved
> elsewhere. I think the code is in the right place.

+1

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: PL/pgSQL, RAISE and error context
Next
From: David Steele
Date:
Subject: Re: Proposal: knowing detail of config files via SQL