Re: when to use NULL and when to NOT NULL DEFAULT ''

From: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
To: Terry Lee Tucker <terry(at)esc1(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: when to use NULL and when to NOT NULL DEFAULT ''
Date: 2004-10-08 11:09:23
Message-ID: 41667563.6050208@zara.6.isreserved.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Btw, MySQL manual used to recommend (or still does?) defining all
columns as NOT NULL as much as possible, "because NULL is slow"... :-)

For me it's pretty obvious, if you are never going to allow the column
to have an "unknown value", then define it NOT NULL to let the database
guarantee that. Otherwise, nullable it is.

Terry Lee Tucker wrote:
> Why would you never define a column as NOT NULL, or am I misunderstanding what
> you are saying?
>
> On Friday 08 October 2004 06:07 am, Peter Eisentraut saith:
>
>>Briefly, you always do the first and never do the second.

--
dave

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Garamond 2004-10-08 11:12:35 Re: when to use NULL and when to NOT NULL DEFAULT ''
Previous Message David Garamond 2004-10-08 10:57:05 text + text