Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XgJox-0003GS-GU for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Oct 2014 20:44:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XgJow-0002C4-PD for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Oct 2014 20:44:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XgJov-0002By-Qa for pgsql-bugs@postgresql.org; Mon, 20 Oct 2014 20:44:50 +0000 Received: from nm20-vm4.bullet.mail.ne1.yahoo.com ([98.138.91.180]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XgJos-0007G3-1u for pgsql-bugs@postgresql.org; Mon, 20 Oct 2014 20:44:48 +0000 Received: from [98.138.100.118] by nm20.bullet.mail.ne1.yahoo.com with NNFMP; 20 Oct 2014 20:44:44 -0000 Received: from [98.138.89.169] by tm109.bullet.mail.ne1.yahoo.com with NNFMP; 20 Oct 2014 20:44:23 -0000 Received: from [127.0.0.1] by omp1025.mail.ne1.yahoo.com with NNFMP; 20 Oct 2014 20:44:23 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 10265.96219.bm@omp1025.mail.ne1.yahoo.com Received: (qmail 1299 invoked by uid 60001); 20 Oct 2014 20:44:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1413837862; bh=8pdk3QkWdg4uLQhi/QfrXjqzuF5eDScE3u3BmAoXAmo=; h=References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=NCAuHewiPBlqgtR0YEYsmxcz9/dG/EplsVjde6M0qgsy+XC1kN8FtT7eY+XfVrFKbNw3z99WupHDr1231+fmS+7G5L4B4AbtHruQq0KDYftk+Jm0LwXLF0IwzBL3EQc/C02tIpWrtltFipyH9SndFtpgcYRZpajnFmBbF+1gOCo= X-YMail-OSG: SKxC1CgVM1kTTtp5hEqi3U1ap2WBNeZoWYYV2Q_C6pdsJK7 6LLk4Sp..DnZwhI60EogxkZiEzqQRD29ok4dISpHlbp2GEnD8rFkO9j.fEiM _iiG7WXv9V6zydqLL_w_gjpgET5zfDl6_9C2oBS2RkjuOVbCQ3FqF2eT6ny6 xw2bDK16e0MyOWObKQGZL6z5un793ZZWA0QSxYIh7pFGlyWtsY1qgfypwupQ Rqgq.ZkaL26b4CwfTA4DdW8o_dLRmRuQ7AjKo6xSVbE0g6NO.7sbI3ptbxKa j8zuvo_5WgDP6G_cCqYk19_26FR0yONsvgpkgbWaEfleLkAYRWpriSmmEcD5 _hDf.QVmJFgzTDQ9T1W3b9rQfZ77R6pXxQJmWl_avQIylo7nf05SnummVczj 0PvPBENr7RepmsWfXn_v55IRaqBYnNdj9AtxSkRwx3IpPRcPkbfZjId8l3fm .0DQUe19Sbjl5en7WPZNNuu7.n9EM0p5mjKaPwF4_w7DMZb5eC7_Kd.J0v45 .35XgDUHR7exVhjpioYZi3IJULj9G3XI5JHwtP_stDqMpTVegK8qrN_8_gKs hLbTWILjp3gxNTDyGpZqj Received: from [71.87.18.210] by web122301.mail.ne1.yahoo.com via HTTP; Mon, 20 Oct 2014 13:44:22 PDT X-Rocket-MIMEInfo: 002.001, ImZpbmtlbEBzZC1pbC5jb20iIDxmaW5rZWxAc2QtaWwuY29tPiB3cm90ZToKPiBXZSBoYXZlIGEgdGFibGUgd2l0aCB0aGlzIGNvbnN0cmFpbnQ6Cgo.Cj4gQ09OU1RSQUlOVCBjaGVja19tX251bGxhYmlsaXR5IENIRUNLICgoKG0xIElTIE5VTEwpIEFORAo.IChtMiBJUyBOVUxMKSkgT1IgKChtMSBJUyBOT1QgTlVMTCkgQU5EIChtMiBJUyBOT1QgTlVMTCkpKQoKTWljaGFlbCBpcyByaWdodCwgYnV0IGluIGFkZGl0aW9uIHRvIHRoYXQgeW91IG1pZ2h0IHdhbnQgdG8gdXNlIHRoZQpzaW1wbGVyIChhbmQgdG8BMAEBAQE- X-Mailer: YahooMailWebService/0.8.203.733 References: <20141017194258.2957.58603@wrigleys.postgresql.org> Message-ID: <1413837862.43723.YahooMailNeo@web122301.mail.ne1.yahoo.com> Date: Mon, 20 Oct 2014 13:44:22 -0700 From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: BUG #11705: \d(escribe) table shows incorrect check constraint To: "finkel@sd-il.com" , "pgsql-bugs@postgresql.org" In-Reply-To: <20141017194258.2957.58603@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pg-Spam-Score: -0.5 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org "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