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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-sql by date

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