BUG #4888: Removed brackets from Check Constraints expressions

From: "stalker" <chimera(at)bk(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4888: Removed brackets from Check Constraints expressions
Date: 2009-06-26 15:37:55
Message-ID: 200906261537.n5QFbtLG001082@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4888
Logged by: stalker
Email address: chimera(at)bk(dot)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".

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2009-06-26 15:57:51 Re: BUG #4879: bgwriter fails to fsync the file in recovery mode
Previous Message Tom Lane 2009-06-26 15:23:29 Re: BUG #4879: bgwriter fails to fsync the file in recovery mode