Re: Can't ri_KeysEqual() consider two nulls as equal?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Can't ri_KeysEqual() consider two nulls as equal?
Дата
Msg-id 4625D2CD.1030200@archonet.com
обсуждение исходный текст
Ответ на Re: Can't ri_KeysEqual() consider two nulls as equal?  ("Simon Riggs" <simon@2ndquadrant.com>)
Список pgsql-hackers
Simon Riggs wrote:
> On Tue, 2007-04-17 at 17:16 -0400, Tom Lane wrote:
>> A recent discussion led me to the idea that FK triggers are fired
>> unnecessarily during an UPDATE if the foreign-key column(s) contain
>> any NULLs, because ri_KeysEqual() treats two nulls as unequal,
>> and therefore we conclude the row has changed when it has not.
> 
> FK trigger *can be optimised away* is true. No need to have a discussion
> about whether NULL == NULL, but the critical test is: if I overwrote it,
> would you be able to tell? The answer is No, so away it goes.

The test should perhaps be named "unchanged" rather than "equal".

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Autovacuum vs statement_timeout
Следующее
От: "sharath kumar"
Дата:
Сообщение: Re: schema creation during initdb