Re: select * from mytable where myfield=null;

From: "Hoanui Morangie" <hoanui(at)excite(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us, marin(dot)dimitrov(at)sirma(dot)bg
Cc: hoanui(at)excite(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: select * from mytable where myfield=null;
Date: 2002-05-14 14:57:27
Message-ID: 20020514145727.F1D47BFB3@xmxpita.excite.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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!

Browse pgsql-jdbc by date

  From Date Subject
Next Message Cathal de Brun 2002-05-14 14:58:52 Re: j2ee compatiable jdbc driver on jdbc.postgresql.org?
Previous Message Tom Lane 2002-05-14 14:42:38 Re: select * from mytable where myfield=null;