"finkel(at)sd-il(dot)com" <finkel(at)sd-il(dot)com> wrote:
> We have a table with this constraint:
>
> CONSTRAINT check_m_nullability CHECK (((m1 IS NULL) AND
> (m2 IS NULL)) OR ((m1 IS NOT NULL) AND (m2 IS NOT NULL)))
Michael is right, but in addition to that you might want to use the
simpler (and to my eye easier to read):
CONSTRAINT check_m_nullability CHECK ((m1 IS NULL) = (m2 IS NULL))
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company