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 20020514145727.F1D47BFB3@xmxpita.excite.com
Whole thread Raw
In response to select * from mytable where myfield=null;  (blamouret <bruno.lamouret@westcast-systems.com>)
List pgsql-jdbc
To my order-invoice example: there are not many choices, I know only three:

1) use NULL value and build proper query (x=? or x is null),
2) use dummy tupples and values (Marin's solution),
3) give up foreign key constraints on the database level and rely on the middle tier.

I have chosen 1).

Hoanui

--- On Tue 05/14, Tom Lane wrote:
> "Marin Dimitrov" writes:
> > don't use NULLs
>
> I agree with Marin. If you think you need x = NULL to act like x IS
> NULL, then you should rethink the way you are using NULL in your data
> design. You are really swimming against the tide of the way that SQL
> specifies NULL to work.
>
> regards, tom lane
>


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

pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: select * from mytable where myfield=null;
Next
From: Cathal de Brun
Date:
Subject: Re: j2ee compatiable jdbc driver on jdbc.postgresql.org?