Re: [SQL] NULL - Mailing list pgsql-sql

From Bruce Stephens
Subject Re: [SQL] NULL
Date
Msg-id 87vh6sc4h0.fsf@cenderis.demon.co.uk
Whole thread Raw
In response to NULL  (Goran Thyni <goran@kirra.net>)
List pgsql-sql
jose soares <jose@sferacarta.com> writes:

> Bruce Stephens ha scritto:

> > No, it's not required.  This came up before with the examples from
> > "The Practical SQL Handbook".  It would be nice to allow it, but there
> > was some reason why to do so would be non-trivial, which I forget.
> > Anyway, it's not in SQL-92.

> - According with SQL-92 every column can store a NULL value by default
>   unless one specify a NOT NULL constraint for the column.

Yes.  NULL would just mean that NULLs are permitted.  So it's not
required, obviously (since this is the default).  

However, many books recommend that you should generally not allow
NULLs: thus, if you force yourself to explicitly say "NULL" or "NOT
NULL", that ought to be a prompt to consider the issue (and you can
spot cases which you may not have thought about by the absence of
either).  I imagine that's why "The Practical SQL Handbook" suggests
it.


pgsql-sql by date:

Previous
From: neko@kredit.sth.szif.hu
Date:
Subject: Re: [SQL] Info on SQL Parsing required
Next
From: Julien Cadiou
Date:
Subject: recursive