Received: from wallace.ece.rice.edu (root@wallace.ece.rice.edu [128.42.12.154]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA21585 for ; Tue, 30 Nov 1999 14:09:07 -0500 (EST) (envelope-from reedstrm@wallace.ece.rice.edu) Received: by wallace.ece.rice.edu via sendmail from stdin id (Debian Smail3.2.0.102) for pgsql-sql@postgresql.org; Tue, 30 Nov 1999 13:09:06 -0600 (CST) Date: Tue, 30 Nov 1999 13:09:06 -0600 From: "Ross J. Reedstrom" To: Tom Lane Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] NULL Message-ID: <19991130130906.D6156@wallace.ece.rice.edu> References: <19991130101246.B6156@wallace.ece.rice.edu> <21582.943985242@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <21582.943985242@sss.pgh.pa.us>; from Tom Lane on Tue, Nov 30, 1999 at 01:07:22PM -0500 On Tue, Nov 30, 1999 at 01:07:22PM -0500, Tom Lane wrote: 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., NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005