Skip site navigation (1) Skip section navigation (2)

check constraint bug?

From: Tarlika Elisabeth Schmitz <postgresql3(at)numerixtechnology(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: check constraint bug?
Date: 2011-05-06 05:06:08
Message-ID: 20110506060608.12bd24b0@dick.coachhouse (view raw or flat)
Thread:
Lists: pgsql-sql
I specified:

ALTER TABLE h ADD CONSTRAINT val_h_stats
CHECK (NOT (sex = 'f') AND (stats IS NOT NULL));

which was translated to:

ALTER TABLE h ADD CONSTRAINT val_h_stats 
CHECK (NOT sex = 'f'::bpchar AND stats IS NOT NULL);


Can the expression not be bracketed?


I changed this to:
ALTER TABLE horse ADD CONSTRAINT val_horse_stats
CHECK (sex != 'f') OR (stats IS NULL));


-- 

Best Regards,
Tarlika Elisabeth Schmitz

Responses

pgsql-sql by date

Next:From: Scott MarloweDate: 2011-05-06 05:10:19
Subject: Re: check constraint bug?
Previous:From: Claudio Adriano GuarracinoDate: 2011-05-06 01:06:14
Subject: Re: Select and merge rows?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group