Re: [BUGS] BUG #14526: no unique or exclusion constraint matching the ON CONFLICT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #14526: no unique or exclusion constraint matching the ON CONFLICT
Дата
Msg-id 8299.1486579881@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #14526: no unique or exclusion constraint matching theON CONFLICT  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: [BUGS] BUG #14526: no unique or exclusion constraint matching theON CONFLICT  (Peter Geoghegan <pg@bowt.ie>)
Список 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 по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: [BUGS] BUG #14526: no unique or exclusion constraint matching theON CONFLICT
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: [BUGS] BUG #14526: no unique or exclusion constraint matching theON CONFLICT