X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 607EFD1DCEE for ; Wed, 10 Mar 2004 12:40:18 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 65022-08 for ; Wed, 10 Mar 2004 08:40:14 -0400 (AST) Received: from greendale.ukc.ac.uk (greendale.ukc.ac.uk [129.12.21.13]) by svr1.postgresql.org (Postfix) with ESMTP id B16BDD1D29F for ; Wed, 10 Mar 2004 08:40:10 -0400 (AST) Received: from pelican.ukc.ac.uk ([129.12.200.26]) by greendale.ukc.ac.uk with esmtp (Exim 4.22) id 1B12zj-0005e1-4P for pgsql-sql@postgresql.org; Wed, 10 Mar 2004 12:39:31 +0000 Received: from dhcp6649.ukc.ac.uk ([129.12.102.73] helo=PC2LP058) by pelican.ukc.ac.uk with smtp (Exim 4.22) id 1B12zg-0001nn-Fy for pgsql-sql@postgresql.org; Wed, 10 Mar 2004 12:39:28 +0000 Message-ID: <008901c4069c$ba6591e0$49660c81@ad.kent.ac.uk> From: "David" To: References: <403F762B.20002@aol.net> <20773.1077905537@sss.pgh.pa.us> Subject: changing constraints Date: Wed, 10 Mar 2004 12:27:05 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-UKC-Mail-System: No virus detected X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/102 X-Sequence-Number: 17201 I tried adding a constraint thus: de4=> ALTER TABLE genus ADD CHECK(gender = 'masculine' || 'feminine'); But get the msg: ERROR: AlterTableAddConstraint: rejected due to CHECK constraint $2 de4=> \d genus Table "public.genus" Column | Type | Modifiers ----------------+-----------------------+----------- genus_name | character varying(20) | not null gender | character varying(10) | cas_gen_number | integer | family_name | character(7) | Indexes: genus_pkey primary key btree (genus_name) Foreign Key constraints: $1 FOREIGN KEY (family_name) REFERENCES family(family_name) ON UPDATE NO ACTION ON DELETE NO ACTION I cant see a $2 constraint so why am i getting the error msg? Many thanks Dave