Re: Nulls get converted to 0 problem - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Nulls get converted to 0 problem
Date
Msg-id 20030606062746.J26692-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Nulls get converted to 0 problem  (Jon Earle <je_pgsql@kronos.honk.org>)
List pgsql-general
On Thu, 5 Jun 2003, Jon Earle wrote:

> On Wed, 4 Jun 2003 terry@ashtonwoodshomes.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?

Because SQL already defines what NULL means to be something else, it's an
unknown value. Also, in C, NULL and "" are different and not very
equivalent (try passing strcmp a NULL rather than empty string on many
systems ;) )


pgsql-general by date:

Previous
From: Avi Schwartz
Date:
Subject: Re: Nulls get converted to 0 problem
Next
From: The Hermit Hacker
Date:
Subject: Re: Estimate of when CVS will be available again?