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

From Ross J. Reedstrom
Subject Re: [SQL] NULL
Date
Msg-id 19991130130906.D6156@wallace.ece.rice.edu
Whole thread Raw
In response to Re: [SQL] NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On Tue, Nov 30, 1999 at 01:07:22PM -0500, Tom Lane wrote:

<snipped excellent description about the problem with NULL as a
column constraint>

Ah, now I understand. And as I said, if it would cause a problem, now or
in the forseeable future, skip it. I propose dropping Tom's explanation
(or a summary of it) into the FAQ. how about :

------------
Q: Why doesn't PostgreSQL support NULL as a column constraint?

Short A: Because it's not in the SQL92 standard.

Long A:

Because of SQL's rather silly decision not to put any punctuation between
column constraint clauses, anything that can start a column constraint
clause can't also be a valid entry in an expression.  Consider
     CREATE TABLE foo (field1 int DEFAULT 2 ++ NULL)

Here, the grammar cannot figure out whether the default expression is
"2 ++ NULL" (with ++ an infix operator) or "2 ++" (++ a postfix operator)
and NULL a separate constraint clause.
------------

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] NULL
Next
From: Zsolt Varga
Date:
Subject: date function questions...