Received: (from news@localhost) by hub.org (8.9.3/8.9.3) id DAA24119 for pgsql-sql@postgresql.org; Fri, 8 Oct 1999 03:25:07 -0400 (EDT) (envelope-from news) X-Authentication-Warning: hub.org: news set sender to using -f From: "Claudio Tassi" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Constraint Problem Date: Fri, 8 Oct 1999 09:28:51 +0200 Organization: NETTuno Message-ID: <7tk68f$prq$1@pinco.nettuno.it> References: <37F319C6.FA5B5536@prima.net.id> X-Trace: pinco.nettuno.it 939367503 26490 193.207.61.131 (8 Oct 1999 07:25:03 GMT) X-Complaints-To: news@nettuno.it X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Lines: 78 To: pgsql-sql@postgreSQL.org Chairudin Sentosa Harjo wrote in message news:37F319C6.FA5B5536@prima.net.id... > Dear Friends, > > I have a very wierd problem. It should be obvious, but I can't > understand why. > > I am using Postgresql 6.5.2, SuSe 6.2, Pentium III, Kernel Linux 2.2.10. > > Please notice the error, it keeps saying ck_ngetest_disc_pin, > ck_ngetest_disc_country > is the cause of the problem. > I have inserted the correct value, but why keep giving error??? > > The wierdest part is, when I insert a value to field "disc_all", the > error mentioned > "ck_ngetest_disc_pin" !!!.... If the constraint was violated, the error > message > should be "ck_ngetest_disc_all". > > > create table ngetest > ( > custnum int8 NOT NULL, > first_name varchar(15) NOT NULL, > service_type char NOT NULL, > sex char NOT NULL, > detailed_bill char NOT NULL, > ngetest_status char NOT NULL, > disc_all char, > disc_country char, > disc_pin char, > > constraint pk_ngetest PRIMARY KEY (custnum), > > constraint ck_ngetest_service_type check > (service_type = 'Y' or > service_type = 'N' or > service_type = 'G' or > service_type = 'M' or > service_type = 'O' or > service_type = 'D'), > > constraint ck_ngetest_status check > (ngetest_status = 'A' or > ngetest_status = 'I' or > ngetest_status = 'S' or > ngetest_status = 'T'), > > constraint ck_ngetest_disc_all check > (disc_all = 'Y' or > disc_all = 'N'), > constraint ck_ngetest_disc_country check > (disc_country = 'Y' or > disc_country = 'N'), > constraint ck_ngetest_disc_pin check > (disc_pin = 'Y' or > disc_pin = 'N') > ); > > insert into ngetest > (custnum, first_name, service_type, sex, detailed_bill, ngetest_status, > disc_all) > values > (1,'Bob','Y','M','Y','A','Y'); > ERROR: ExecAppend: rejected due to CHECK constraint ck_ngetest_disc_pin disc_pin is null in this statement and constraint ck_ngetest_disc_pin says that it can' t be null Bye Claudio