Re: NULL vs. Empty String - Mailing list pgsql-general

From David Wheeler
Subject Re: NULL vs. Empty String
Date
Msg-id Pine.LNX.4.21.0103140851320.12837-100000@theory
Whole thread Raw
In response to Re: NULL vs. Empty String  ("Oliver Elphick" <olly@lfix.co.uk>)
List pgsql-general
On Wed, 14 Mar 2001, Oliver Elphick wrote:

> You could write a rule for each table/column that would substitute
> NULL for ''.
>
> However, the concept is all wrong.  NULL means "I don't know what
> this value is". '' means "I know that this value is an empty string".
> Furthermore, having NULLs in columns means you have to be careful
> to use ternary logic for every condition (because NULL=x is neither
> true nor false).

And On Wed, 14 Mar 2001, Steven Lembark wrote:

> Postgress is doing what you want it to -- see anything CJ Date
> has written in the last 20 years.  you are better off inserting
> a default value of '' than NULL -- otherwise you have no idea
> what joins mean.

I completely agree with you two that PostgreSQL does The Right Thing (TM)
vs. what Oracle does. Thus, perhaps I should shift the focus of my queries
to the mod_perl list, since I think it makes sense that empty form fields
submitted from a web page should show up in Perl as undefined (and
therefore will be inserted into Postgres as NULL) rather than as empty
strings.

Thanks for the feedback.

David





pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg_hba.conf "sameuser"
Next
From: Chris Jones
Date:
Subject: Re: Maximum size of one table