Re: postgresql vs mysql

From: Mark Walker <furface(at)omnicode(dot)com>
To: Brandon Aiken <BAiken(at)winemantech(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql vs mysql
Date: 2007-02-22 22:29:43
Message-ID: 45DE1957.6040108@omnicode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>If you don't know something, why are you trying to record it? From a strict relational sense, the existence of NULL values in your fields indicates that your primary keys are not
truly candidate keys for all your fields. That means your database isn't [BCNF] normalized.<<<

I agree that there are very few times when NULL is appropriate in a database. I can't think of a single concrete example to use it in a database field.

It has its use in programming, mainly as a memory management/trash collection mechanism. Basically, you don't want to delete something that doesn't exist.

For example:

Statement *st = NULL;
ResultSet *rs = NULL;
try
{
st = prepareStatement("select * from customers");
rs = st->executeQuery();
while (rs->next())
{
do something
}
delete st;
delete rs;
}
catch (Exception e)
{
if (st != NULL)
delete st;
if (rs != NULL)
delete rs;
}

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2007-02-22 22:51:25 Re: what compression is used in on disk bitmap index implementation
Previous Message Martijn van Oosterhout 2007-02-22 22:15:08 Re: complex referential integrity constraints