pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] NULL
Date: Tue, 30 Nov 1999 13:09:06 -0600
Message-ID: <19991130130906.D6156@wallace.ece.rice.edu> (raw)
In-Reply-To: <21582.943985242@sss.pgh.pa.us>
References: <19991130101246.B6156@wallace.ece.rice.edu>
<21582.943985242@sss.pgh.pa.us>
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
view thread (18+ messages) latest in thread
Message-ID: <19991130130906.D6156@wallace.ece.rice.edu> Permalink: ../19991130130906.D6156@wallace.ece.rice.edu/ Also on: postgresql.org/message-id/19991130130906.D6156@wallace.ece.rice.edu ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients using the --to and --cc options: reply via email To: pgsql-sql@postgresql.org Cc: reedstrm@wallace.ece.rice.edu, tgl@sss.pgh.pa.us Subject: Re: [SQL] NULL In-Reply-To: <19991130130906.D6156@wallace.ece.rice.edu> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox