Re: NULLS and User Input WAS Re: multimaster

From: PFC <lists(at)peufeu(dot)com>
To: harding(dot)ian(at)gmail(dot)com, "Alexander Staubo" <alex(at)purefiction(dot)net>
Cc: "General PostgreSQL List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: NULLS and User Input WAS Re: multimaster
Date: 2007-06-03 22:37:42
Message-ID: op.ttdag4vycigqcu@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> Yeah, it is awful ;^) However the existing system is equally awful
> because there is no way to enter NULL!

Consider this form :

First name : Edgar
Middle name : J.
Last name : Hoover

Now, if someone has no middle name, like "John Smith", should we use NULL
or "" for the middle name ?
NULL usually means "unknown" or "not applicable", so I believe we have to
use the empty string here. It makes sense to be able to concatenate the
three parts of the name, without having to put COALESCE() everywhere.

Now consider this form :

City :
State :
Country :

If the user doesn't live in the US, "State" makes no sense, so it should
be NULL, not the empty string. There is no unnamed state. Also, if the
user does not enter his city name, this does not mean he lives in a city
whose name is "". So NULL should be used, too.

It is very context-dependent.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message PFC 2007-06-03 22:41:24 Re: why postgresql over other RDBMS
Previous Message Andreas 'ads' Scherbaum 2007-06-03 22:34:44 Re: New Live CD needed