Re: Foreign key verification trigger conditions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Foreign key verification trigger conditions
Дата
Msg-id 16841.1243866017@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Foreign key verification trigger conditions  (j-lists <jamisonlists@gmail.com>)
Ответы Re: Foreign key verification trigger conditions  (j-lists <jamisonlists@gmail.com>)
Список pgsql-general
j-lists <jamisonlists@gmail.com> writes:
> I have an update statement that affects every row in a given table.
> For that table it changes the value in a single column, which itself
> has a foreign key constraint. The table has an additional 9 foreign
> keys, some of which reference large tables.
> My expectation would be that only the changed column would be checked
> against the foreign key of interest, instead I find that all the
> foreign keys are checked when this statement is executed.

What your test case actually seems to show is that the skip-the-trigger
optimization doesn't fire when the column value is NULL.  Which is
because ri_KeysEqual() doesn't consider two nulls to be equal.  It's
possible we could change that but I'd be worried about breaking other
cases that are actually semantically critical...

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: ruby connect
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump & table space