Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V1Gjy-0003fR-Mp for pgsql-sql@arkaria.postgresql.org; Mon, 22 Jul 2013 14:05:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V1Gjy-0002IB-3U for pgsql-sql@arkaria.postgresql.org; Mon, 22 Jul 2013 14:05:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V1Gjx-0002I5-Fg for pgsql-sql@postgresql.org; Mon, 22 Jul 2013 14:05:29 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V1Gjq-0003tf-O3 for pgsql-sql@postgresql.org; Mon, 22 Jul 2013 14:05:29 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1V1Gjp-0003c9-P0 for pgsql-sql@postgresql.org; Mon, 22 Jul 2013 07:05:21 -0700 Date: Mon, 22 Jul 2013 07:05:21 -0700 (PDT) From: ldrlj1 To: pgsql-sql@postgresql.org Message-ID: <1374501921767-5764645.post@n5.nabble.com> Subject: table constraint on two columns MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.8 (+) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Postgres 9.2.4. I have two columns, approved and comments. Approved is a boolean with no default value and comments is a character varying (255) and nullable. I am trying to create a constraint that will not allow a row to be entered if approved is set to false and comments is null. This does not work. yada, yada, yada... add constraint "chk_comments' check (approved = false and comments is not null). The constraint is successfully added, but does not work as I expected. -- View this message in context: http://postgresql.1045698.n5.nabble.com/table-constraint-on-two-columns-tp5764645.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql