Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ua5Dq-00023G-Jg for pgsql-bugs@arkaria.postgresql.org; Wed, 08 May 2013 14:19:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Ua5Dp-00061K-H6 for pgsql-bugs@arkaria.postgresql.org; Wed, 08 May 2013 14:19:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ua45S-0006tQ-1f for pgsql-bugs@postgresql.org; Wed, 08 May 2013 13:07:14 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ua45L-0001cd-JS for pgsql-bugs@postgresql.org; Wed, 08 May 2013 13:07:13 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ua45J-0004Ua-Jo for pgsql-bugs@postgresql.org; Wed, 08 May 2013 13:07:07 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1Ua45E-0001tQ-Dd for pgsql-bugs@postgresql.org; Wed, 08 May 2013 13:07:00 +0000 Date: Wed, 08 May 2013 13:07:00 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #8141: multi-column check expression evaluating to NULL To: pgsql-bugs@postgresql.org From: andras.vaczi@zalando.de X-Pg-Spam-Score: -3.3 (---) 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 The following bug has been logged on the website: Bug reference: 8141 Logged by: Andras Vaczi Email address: andras.vaczi@zalando.de PostgreSQL version: 9.1.9 Operating system: linux/Ubuntu 12.10 Description:=20=20=20=20=20=20=20=20 Consider the following table with a CHECK constraint: CREATE TABLE check_test ( id integer NOT NULL, col integer, CONSTRAINT unique_with_null_check1 CHECK (col >=3D 1 AND id < 20) ); This INSERT statement succeeds: INSERT INTO check_test (id, col) VALUES (1, NULL); While, col being NULL, the whole CHECK condition evaluates to NULL - this is covered in the documentation. But this is refused: INSERT INTO check_test (id, col) VALUES (21, NULL); ERROR: new row for relation "check_test" violates check constraint "unique_with_null_check1" I think this behaviour should be either also mentioned in the docs or cosidered a bug. --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs