Re: TEXT and NULL...

From: Dan Weston <ddweston(at)cinesite(dot)com>
To: Herbert Liechti <Herbert(dot)Liechti(at)thinx(dot)ch>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: TEXT and NULL...
Date: 2002-06-17 19:08:34
Message-ID: Pine.LNX.4.33.0206171204350.11007-100000@musk.hollywood.cinesite.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Whether storing NULL values in a relational database is a good idea is at
best highly contentious. Chris Date, one of the pioneers of relational
database theory, rejects them outright as a violation of the relational
model. You might want to check out one of his books and then make up your
own mind.

One thing that an empty string has going for it is that "" = "", and
nothing else does, whereas NULL is not equal to null (and is not even a
value).

Food for thought...

Dan Weston

On Mon, 17 Jun 2002, Herbert Liechti wrote:

> On Mon, 17 Jun 2002, Egon Sommer wrote:
> > Hallo all,
> >
> > Does it make any difference to save "no data" in a column with type TEXT or BYTEA as "" (empty string) or null?
> > Is one of it faster or more wast of memory?
>
> Always store NULL instead of empty strings. This will it make much
> more easier in programming where you don't have to bother about
> two conditions (NULL and empty string). An empty string on the
> other hand may be a value in an application context where NULL is per
> definition always the same. Storing NULL values is a good feature
> of DBMS so use it ;-) Querying NULL values is part of the SQL-Syntax.
>
> Best regards
> Herbie
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Jenkins 2002-06-17 19:36:57 Re: create definiton
Previous Message Josh Berkus 2002-06-17 19:02:34 Re: Fw: (orig posted to usenet) Advice req for restricting entry values]