Re: Nulls get converted to 0 problem

From: terry(at)greatgulfhomes(dot)com
To: "'Jon Earle'" <je_pgsql(at)kronos(dot)honk(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Nulls get converted to 0 problem
Date: 2003-06-06 11:28:29
Message-ID: 002401c32c1e$c32c3080$2766f30a@development.greatgulfhomes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

One good reason not interpret the empty string as NULL is because the empty
string could violate a foreign key constraint, whereas a NULL says "don't
evaluate the fkey constraint, there is no value here for this row"

Terry Fielder
Manager Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
terry(at)greatgulfhomes(dot)com
Fax: (416) 441-9085

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Jon Earle
> Sent: Thursday, June 05, 2003 9:39 AM
> To: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Nulls get converted to 0 problem
>
>
> On Wed, 4 Jun 2003 terry(at)ashtonwoodshomes(dot)com wrote:
>
> > Oracle *incorrectly* interprets blank (empty) strings as
> NULL. They are NOT
> > the same. A string of zero characters is a string
> nonetheless. A NULL is
> > "the absence of value", which equals nothing (theoretically
> not even another
> > NULL).
>
> If you're testing a value, you're testing to see if there's
> something in
> there or not - what difference does it make if the variable
> contains 0, ""
> or NULL?
>
> Why not adhere to the practices inherent (and thus anticipated by
> developers) in other languages (C comes to mind) where 0,
> NULL and "" are
> equivalent?
>
> Cheers!
>
> --
> Jon Earle
>
> SAVE FARSCAPE http://www.savefarscape.com/
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message kdebisschop 2003-06-06 11:39:40 Re: Nulls get converted to 0 problem
Previous Message Ron Johnson 2003-06-06 10:34:01 Re: Create index on the year of a date column