Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA70954 for ; Sun, 17 Oct 1999 11:58:33 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id LAA12785; Sun, 17 Oct 1999 11:58:00 -0400 (EDT) To: Stephan Bauer cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] NOT NULL and postgres 6.5.2 In-reply-to: Your message of Sat, 16 Oct 1999 20:10:02 +0200 <3808BF7A.A83120D5@gmx.de> Date: Sun, 17 Oct 1999 11:58:00 -0400 Message-ID: <12783.940175880@sss.pgh.pa.us> From: Tom Lane Stephan Bauer writes: > CREATE TABLE anzeigen ( > ... > name varchar(30) NOT NULL, > ... > ); > The following statement _will_ be inserted: > INSERT INTO anzeigen ( ... name ...) > VALUES ( ..., '', ...); > What is my problem? An empty string '' is quite different from a NULL. If you want to forbid empty strings you could add a constraint expression, eg, CHECK (name <> ''). regards, tom lane