Re: (FAQ?) JOIN condition - 'WHERE NULL = NULL'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ian Sillitoe" <ian(dot)sillitoe(at)googlemail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: (FAQ?) JOIN condition - 'WHERE NULL = NULL'
Date: 2008-04-02 18:53:20
Message-ID: 12570.1207162400@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Ian Sillitoe" <ian(dot)sillitoe(at)googlemail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rodrigo E. De León Plicet 2008-04-02 18:57:00 Re: Problem with planner choosing nested loop
Previous Message Ian Sillitoe 2008-04-02 18:43:27 Re: (FAQ?) JOIN condition - 'WHERE NULL = NULL'