Search Postgresql Archives

Re: postgresql vs mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux