From: Kevin Grittner <kgrittn@ymail.com>
To: finkel@sd-il.com <finkel@sd-il.com>
To: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #11705: \d(escribe) table shows incorrect check constraint
Date: Mon, 20 Oct 2014 13:44:22 -0700
Message-ID: <1413837862.43723.YahooMailNeo@web122301.mail.ne1.yahoo.com> (raw)
In-Reply-To: <20141017194258.2957.58603@wrigleys.postgresql.org>
References: <20141017194258.2957.58603@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
"finkel@sd-il.com" <finkel@sd-il.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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: kgrittn@ymail.com, finkel@sd-il.com
Subject: Re: BUG #11705: \d(escribe) table shows incorrect check constraint
In-Reply-To: <1413837862.43723.YahooMailNeo@web122301.mail.ne1.yahoo.com>
References: <20141017194258.2957.58603@wrigleys.postgresql.org> <1413837862.43723.YahooMailNeo@web122301.mail.ne1.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox