Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA32765 for ; Wed, 17 Nov 1999 08:56:59 -0500 (EST) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.9.3/8.9.3/NETTuno 3.3) with ESMTP id OAA00699; Wed, 17 Nov 1999 14:53:41 +0100 (MET) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) id 11o7F7-00018H-00; Wed, 17 Nov 1999 15:43:33 +0000 Message-ID: <3832B3FF.A3F3F9F1@sferacarta.com> Date: Wed, 17 Nov 1999 14:56:16 +0100 From: jose soares X-Mailer: Mozilla 4.5 [it] (Win95; I) X-Accept-Language: it MIME-Version: 1.0 To: Jan Wieck CC: bruce@cenderis.demon.co.uk, pgsql-sql@postgresql.org Subject: Re: [SQL] NULL References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Jan Wieck ha scritto: > > > > It suppose to mean that NULLs are explicitly allowed in > > > > this field. > > > > Is this required by SQL-92? > > > > > > 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. > > > > > Sorry, I don't understand why we need this feature. This is completely ou= > > t > > of standard. > > > > What's that mean ? > > > > - Is it a constraint to allow only NULL values ? (unuseful) > > Useless? I NEED IT - URGENT - NOW - YESTERDAY. > > Then I could create my tables with all required fields for > the future, but prevent that someone stores data in them > until I drop the constraint. Maybe I miss something here, Jan...I think you don't need such thing to do this kind of work. To drop the constraint you have: 1) download the table 2) modify the table structure (without constraint NULL) 3) re-create the table 4) reload it again. You have the same effect as: 1) download the table 2) add new filelds to table structure 3) re-create the table 4) reload it again ...but, if want these fields from the begining you may create a CHECK contraint for the field, like: CREATE TABLE distributors ( did DECIMAL(3), name VARCHAR(40), avoid INTEGER CONSTRAINT con1 CHECK (avoid is NULL) ); insert into distributors values (33,'PIPPO',123); ERROR: ExecAppend: rejected due to CHECK constraint con1 insert into distributors values (33,'PIPPO',NULL); INSERT 1484300 1 select * from distributors; did|name |avoid ---+-----+----- 33|PIPPO| (1 row) ...and this is SQL-92 Standard ;) José