Re: [BUGS] BUG #14526: no unique or exclusion constraint matching the ON CONFLICT - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14526: no unique or exclusion constraint matching the ON CONFLICT
Date
Msg-id 8299.1486579881@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #14526: no unique or exclusion constraint matching theON CONFLICT  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: [BUGS] BUG #14526: no unique or exclusion constraint matching theON CONFLICT  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-bugs
Peter Geoghegan <pg@bowt.ie> writes:
> On Tue, Feb 7, 2017 at 5:41 PM, Peter Geoghegan <pg@bowt.ie> wrote:
>> It won't work with deferrable constraints (even when immediate
>> enforcement is in effect, so obscure reasons). Enforcement occurs in
>> the executor -- see ExecCheckIndexConstraints().

> This is actually noted directly within infer_arbiter_indexes(), about
> half way down:
>  * Let executor complain about !indimmediate case directly, because
>  * enforcement needs to occur there anyway when an inference clause is
>  * omitted.

I'm not following.  If the executor needs to check too, that's fine,
but why is it okay for the planner not to check?  Assume that for some
weird reason the user has both indimmediate and !indimmediate indexes
on the same column set.  If the planner chooses the wrong one, don't
bad things happen?  If it doesn't matter which index the planner
picks, why are we doing this at plan time at all?

            regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [BUGS] BUG #14526: no unique or exclusion constraint matching theON CONFLICT
Next
From: Peter Geoghegan
Date:
Subject: Re: [BUGS] BUG #14526: no unique or exclusion constraint matching theON CONFLICT