Search Postgresql Archives

Re: Need efficient way to do comparison with NULL as an option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"D. Dante Lorenso" <dante@xxxxxxxxxxx> writes:
> I'm looking for an operator that will compare NULL with NULL and 
> evaluate as TRUE.

regression=# select null IS NOT DISTINCT FROM 42;
 ?column? 
----------
 f
(1 row)

regression=# select null IS NOT DISTINCT FROM null;
 ?column? 
----------
 t
(1 row)

However, if you're expecting this to be real efficient (like, use an
index), you're out of luck ...

> If the value I'm comparing is 0, I want it to match the NULL values.

[ raised eyebrow... ]  Sir, you need to rethink your data
representation.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux