From: Paul Thomas <paul@tmsl.demon.co.uk>
To: David <de4@kent.ac.uk>
Cc: pgsql-sql @ postgresql . org <pgsql-sql@postgresql.org>
Subject: Re: changing constraints
Date: Wed, 10 Mar 2004 13:07:49 +0000
Message-ID: <20040310130749.A14958@bacon> (raw)
In-Reply-To: <008901c4069c$ba6591e0$49660c81@ad.kent.ac.uk>
References: <403F762B.20002@aol.net>
<20773.1077905537@sss.pgh.pa.us>
<008901c4069c$ba6591e0$49660c81@ad.kent.ac.uk>
On 10/03/2004 12:27 David wrote:
> 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
Just guessing but maybe it's because gender is nullable?
--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: paul@tmsl.demon.co.uk, de4@kent.ac.uk
Subject: Re: changing constraints
In-Reply-To: <20040310130749.A14958@bacon>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox