Re: Perfornamce Q

Поиск
Список
Период
Сортировка
От Jean-Christian Imbeault
Тема Re: Perfornamce Q
Дата
Msg-id 3E2F8549.2060209@mega-bucks.co.jp
обсуждение исходный текст
Ответ на Perfornamce Q  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Ответы Re: Perfornamce Q  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
Tom Lane wrote:
>
> Doesn't matter: any update will fire the foreign-key check trigger.
>
> Whether this is necessary or not I dunno, but someone's thought of
> it before: in the code I see
>     /*
>      * Note: We cannot avoid the check on UPDATE, even if old and new key
>      * are the same. Otherwise, someone could DELETE the PK that consists
>      * of the DEFAULT values, and if there are any references, a ON DELETE
>      * SET DEFAULT action would update the references to exactly these
>      * values but we wouldn't see that weired case (this is the only place
>      * to see it).
>      */

I don't quite understand the comment but I guess it mean that an "ON
DELETE SET DEFAULT" might be triggered by an UPDATE, and that "ON DELETE
SET DEFAULT" might affect the PK, AND because of this possible scenario
the FK check is needed.

Is there any way for me to turn the behaviour off during my updates?

Could this be added to the to-do list (if feasible)?

- skip FK (any?) constraint checks on UPDATE if the affected update
column(s) have no constraints/check on them.

Thanks,

Jc


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

Предыдущее
От: Jean-Christian Imbeault
Дата:
Сообщение: Is there a floating-point division function/operator?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Perfornamce Q