On Wednesday 10 March 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
> I cant see a $2 constraint so why am i getting the error msg?
Firstly, $2 will be the automatically created name for this new constraint.
Secondly || doesn't mean OR - it joins strings.
Try something like (untested):
ALTER TABLE genus ADD CONSTRAINT valid_gender CHECK (gender IN
In response to
pgsql-sql by date
|Next:||From: Jander Rebelo Luiz||Date: 2004-03-10 14:29:58|
|Subject: Break a Report in Run Time|
|Previous:||From: Achilleus Mantzios||Date: 2004-03-10 13:41:20|
|Subject: Re: changing constraints|