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

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Miles Keaton <mileskeaton(at)gmail(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 10:07:26
Message-ID: 200410081207.26607.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Freitag, 8. Oktober 2004 07:22 schrieb Miles Keaton:
> What's the prevailing wisdom & best-practice advice about when to let
> a varchar (or any) column be NULL, and when to make it NOT NULL
> DEFAULT '' (or '0000-00-00' or whatever) - in PostgreSQL?

Briefly, you always do the first and never do the second.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2004-10-08 10:20:48 Re: when to use NULL and when to NOT NULL DEFAULT ''
Previous Message David Garamond 2004-10-08 10:02:48 Re: 8.0 questions