Re: [SQL] NULL

From: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] NULL
Date: 1999-11-30 19:09:06
Message-ID: 19991130130906.D6156@wallace.ece.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Zsolt Varga 1999-11-30 19:15:21 date function questions...
Previous Message Tom Lane 1999-11-30 18:07:22 Re: [SQL] NULL