BUG #11705: \d(escribe) table shows incorrect check constraint - Mailing list pgsql-bugs

From finkel@sd-il.com
Subject BUG #11705: \d(escribe) table shows incorrect check constraint
Date
Msg-id 20141017194258.2957.58603@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #11705: \d(escribe) table shows incorrect check constraint  (Michael Paquier <michael.paquier@gmail.com>)
Re: BUG #11705: \d(escribe) table shows incorrect check constraint  (Kevin Grittner <kgrittn@ymail.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      11705
Logged by:          Joel Finkel
Email address:      finkel@sd-il.com
PostgreSQL version: 9.1.13
Operating system:   x86_64-unknown-linux-gnu
Description:

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)))

When we \d <table name> it is listed as:

Check constraints:
    "check_m_nullability" CHECK (m1 IS NULL AND m2 IS NULL OR m1 IS NOT NULL
AND m2 IS NOT NULL)"

The application of the constraint appears to be correct.  The problem is
that \d is dropping important parentheses in its output; so it is showing an
incorrect description.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #10680: LDAP bind password leaks to log on failed authentication
Next
From: chenhj
Date:
Subject: 32 bit libpq fail to connecting when set a very large "connect_timeout" value