From: | "Hoanui Morangie" <hoanui(at)excite(dot)com> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: select * from mytable where myfield=null; |
Date: | 2002-05-14 14:21:52 |
Message-ID: | 20020514142152.63EC9BF8F@xmxpita.excite.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general 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!
From | Date | Subject | |
---|---|---|---|
Next Message | Erwin Ambrosch | 2002-05-14 14:24:13 | Question about SERIAL |
Previous Message | Robert Abbate | 2002-05-14 14:21:37 | Re: transitioning postgres oid |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-05-14 14:42:38 | Re: select * from mytable where myfield=null; |
Previous Message | Jorg Janke | 2002-05-14 14:04:12 | Re: select * from mytable where myfield=null; |