Received: from ip.zadarnet.hr (qmailr@ip.zadarnet.hr [195.29.197.33]) by hub.org (8.9.3/8.9.3) with SMTP id NAA01160 for ; Mon, 20 Sep 1999 13:04:52 -0400 (EDT) (envelope-from ivo@ultra.hr) Received: (qmail 32204 invoked by uid 1001); 20 Sep 1999 17:04:48 -0000 Date: Mon, 20 Sep 1999 19:04:48 +0200 From: Ivo Simicevic To: Margarita Barvinok Cc: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] Not Null Field Message-ID: <19990920190447.B32064@ultra.hr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: ; from Margarita Barvinok on Mon, Sep 20, 1999 at 11:34:42AM -0400 On Mon, Sep 20, 1999 at 11:34:42AM -0400, Margarita Barvinok wrote: > > Hi, > > I created the phonebook table with NOT NULL fileds: > > create table phonebook ( > first varchar(20) NOT NULL, > last varchar(20) NOT NULL, > uniqname char(8) NOT NULL PRIMARY KEY, > phone varchar(30), > status char(7) NOT NULL, > room varchar(40) ); > > If I try to insert NULL values into those fields from psql I got an error > message - that is right. > But when I insert records from my C-program (with embedded SQL) I dot no > errors and such records are added to the table. I even can insert empty > record. Why this happens? Do I need to write some code to check NULL > values? > > Thank you, > -Margarita How are you doing it? Can you send your source? I guess you are not entering NULL but empty string values. Ivo.