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

From Hoanui Morangie
Subject Re: select * from mytable where myfield=null;
Date
Msg-id 20020514142152.63EC9BF8F@xmxpita.excite.com
Whole thread Raw
In response to select * from mytable where myfield=null;  (blamouret <bruno.lamouret@westcast-systems.com>)
List pgsql-jdbc
Well Marin, it is a solution but I'm afraid it would bring more troubles then benefits. You have dummy values and dummy tupples and have to be careful all the time to prevent mess in your data. I prefer using NULL value - it's interpretation unambiguous.

Hoanui


--- On Tue 05/14, Marin Dimitrov wrote:
>
> ----- 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. "
>
>
>
>


Join Excite! - http://www.excite.com
The most personalized portal on the Web!

pgsql-jdbc by date:

Previous
From: "Jorg Janke"
Date:
Subject: Re: select * from mytable where myfield=null;
Next
From: Tom Lane
Date:
Subject: Re: select * from mytable where myfield=null;