Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uf9yC-0003l9-MC for pgsql-bugs@arkaria.postgresql.org; Wed, 22 May 2013 14:24:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Uf9yC-0003jP-6k for pgsql-bugs@arkaria.postgresql.org; Wed, 22 May 2013 14:24:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UexMY-0007I1-CC for pgsql-bugs@postgresql.org; Wed, 22 May 2013 00:57:06 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UexMV-0001Ek-LE for pgsql-bugs@postgresql.org; Wed, 22 May 2013 00:57:06 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UexMU-0008WH-Gz for pgsql-bugs@postgresql.org; Wed, 22 May 2013 00:57:02 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1UexMP-0006so-A5 for pgsql-bugs@postgresql.org; Wed, 22 May 2013 00:56:57 +0000 Date: Wed, 22 May 2013 00:56:57 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #8175: Check constraint fails for valid data. ( rounding related? ) To: pgsql-bugs@postgresql.org From: dan.libby@gmail.com X-Pg-Spam-Score: -2.1 (--) 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: 8175 Logged by: Dan Libby Email address: dan.libby@gmail.com PostgreSQL version: 9.1.6 Operating system: Linux ( Ubuntu 12.04 ) Description:=20=20=20=20=20=20=20=20 -- Try this script -- create table test1 ( val1 numeric(23,8), val2 numeric(23,8), product numeric(23,8) check( product =3D val1 * val2 ) ); select (2.23567567*3.70000000)::numeric(23,8); insert into test1 values ( 3.70000000, 2.23567567, 8.27199998 ); insert into test1 values ( 3.70000000, 2.23567567, 2.23567567*3.70000000 ); insert into test1 values ( 3.70000000, 2.23567567, (2.23567567*3.70000000)::numeric(23,8) ); -- Actual Results -- select (2.23567567*3.70000000)::numeric(23,8); numeric | 8.27199998 btcx=3D# insert into test1 values ( 3.70000000, 2.23567567, 8.27199998 ); ERROR: new row for relation "test1" violates check constraint "test1_check" btcx=3D# insert into test1 values ( 3.70000000, 2.23567567, 2.23567567*3.70000000 ); ERROR: new row for relation "test1" violates check constraint "test1_check" btcx=3D# insert into test1 values ( 3.70000000, 2.23567567, (2.23567567*3.70000000)::numeric(23,8) ); ERROR: new row for relation "test1" violates check constraint "test1_check" -- Expected Results -- All values should be inserted successfully. --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs