Re: (FAQ?) JOIN condition - 'WHERE NULL = NULL' - Mailing list pgsql-general

From Tom Lane
Subject Re: (FAQ?) JOIN condition - 'WHERE NULL = NULL'
Date
Msg-id 12570.1207162400@sss.pgh.pa.us
Whole thread Raw
In response to Re: (FAQ?) JOIN condition - 'WHERE NULL = NULL'  ("Ian Sillitoe" <ian.sillitoe@googlemail.com>)
List pgsql-general
"Ian Sillitoe" <ian.sillitoe@googlemail.com> writes:
> Thanks for the reply - after a bit more poking around it seems that:
> t1.col IS NOT DISTINCT FROM t2.col
> should work - although I guess this means an upgrade from 8.1 to 8.3

Note that while this will give you the right answers, it will probably
be dog-slow because the planner has exactly zero intelligence about it.
You'd be much better advised to reconsider your table design and get
rid of the assumption that NULLs should be considered "equal".

            regards, tom lane

pgsql-general by date:

Previous
From: "Ian Sillitoe"
Date:
Subject: Re: (FAQ?) JOIN condition - 'WHERE NULL = NULL'
Next
From: "Rodrigo E. De León Plicet"
Date:
Subject: Re: Problem with planner choosing nested loop