Re: select * from mytable where myfield=null; - Mailing list pgsql-jdbc

From Marin Dimitrov
Subject Re: select * from mytable where myfield=null;
Date
Msg-id 00b701c1fb4e$d9532410$9ba1d53e@sirma.bg
Whole thread Raw
In response to Re: select * from mytable where myfield=null;  ("Hoanui Morangie" <hoanui@excite.com>)
List pgsql-jdbc
----- Original Message -----
From: "Hoanui Morangie"

>
> I need NULL value, some of these columns are foreign keys.

introduce dummy tupples too, f.e. if u consider 0 as the NULL for numbers,
then have a dummy row with ID=0, so that the FK won't be violated and u'll
still have NULL semantics

>And using dummy values is not good practice anyway.
>

indeed, 3-valued logic (nulls) is often considered as a flaw and NULL usage
is not recommended.
And in your case u won't make use of any indexes for the queries, because
these null values can't be indexed


    Marin

----
"...what you brought from your past, is of no use in your present. When
you must choose a new path, do not bring old experiences with you.
Those who strike out afresh, but who attempt to retain a little of the
old life, end up torn apart by their own memories. "




pgsql-jdbc by date:

Previous
From: "Hoanui Morangie"
Date:
Subject: Re: select * from mytable where myfield=null;
Next
From: "Hoanui Morangie"
Date:
Subject: Re: enquiring