BUG #4888: Removed brackets from Check Constraints expressions - Mailing list pgsql-bugs

From stalker
Subject BUG #4888: Removed brackets from Check Constraints expressions
Date
Msg-id 200906261537.n5QFbtLG001082@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4888: Removed brackets from Check Constraints expressions
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4888
Logged by:          stalker
Email address:      chimera@bk.ru
PostgreSQL version: 8.3.7
Operating system:   Debian 4.0 (etch)
Description:        Removed brackets from Check Constraints expressions
Details:

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.

CREATE TABLE Catalog
(
  id     integer,
  id_lft integer, -- nested set
  id_rgt integer,
);

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".

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4879: bgwriter fails to fsync the file in recovery mode
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #4879: bgwriter fails to fsync the file in recovery mode