Re: Can't ri_KeysEqual() consider two nulls as equal? - Mailing list pgsql-hackers

From Richard Huxton
Subject Re: Can't ri_KeysEqual() consider two nulls as equal?
Date
Msg-id 4625D2CD.1030200@archonet.com
Whole thread Raw
In response to Re: Can't ri_KeysEqual() consider two nulls as equal?  ("Simon Riggs" <simon@2ndquadrant.com>)
List 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 by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Autovacuum vs statement_timeout
Next
From: "sharath kumar"
Date:
Subject: Re: schema creation during initdb