"stalker" <chimera@bk.ru> writes:
> I try to create Check Constraints for DB with Nested Set data model. When I
> write complex validation rule with OR-operator - result Description is
> incorrect.
> ALTER TABLE Catalog
> ADD CONSTRAINT ctg_check_ns CHECK (id_lft > id_rgt OR (id_lft = 0 AND
> id_lft = 0));
> Result:
> 'ctg_check_ns' Definition == "id_lft > id_rgt OR id_lft = 0 AND id_lft =
> 0".
Looks perfectly correct to me. AND binds more tightly than OR.
regards, tom lane