Re: postgresql vs mysql - Mailing list pgsql-general

From Mark Walker
Subject Re: postgresql vs mysql
Date
Msg-id 45DE1957.6040108@omnicode.com
Whole thread Raw
In response to Re: postgresql vs mysql  ("Brandon Aiken" <BAiken@winemantech.com>)
List pgsql-general
>>>If you don't know something, why are you trying to record it?  From a strict relational sense, the existence of NULL
valuesin 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
exampleto 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
deletesomething 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;
}



pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: complex referential integrity constraints
Next
From: Alexander Elgert
Date:
Subject: Re: massive memory allocation until machine crashes