Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ya2yv-0007PK-Al for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Mar 2015 14:05:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ya2yu-0006uq-Pc for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Mar 2015 14:05:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YZ2pz-0000g3-CB for pgsql-bugs@postgresql.org; Fri, 20 Mar 2015 19:44:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YZ2pv-000730-KS for pgsql-bugs@postgresql.org; Fri, 20 Mar 2015 19:44:06 +0000 MIME-Version: 1.0 Subject: BUG #12885: The result of casting a double to an integer depends on the database version To: pgsql-bugs@postgresql.org From: rschaaf@commoninf.com Date: Fri, 20 Mar 2015 19:43:37 +0000 Message-ID: <20150320194337.2573.72944@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.2 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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: 12885 Logged by: Rich Schaaf Email address: rschaaf@commoninf.com PostgreSQL version: 9.4.1 Operating system: Windows 7 Description: The result returned by the following query appears to depend on the PostgreSQL database version. The query is: select column1 AS double_value, cast(column1 AS INT) AS int_value from (VALUES (-2.5::double precision), (-1.5::double precision), (-0.5::double precision), (0.5::double precision), (1.5::double precision), (2.5::double precision)) t; In PostgreSQL 9.3.5, the query returns: double_value, int_value -2.5, -3 -1.5, -2 -0.5, -1 0.5, 1 1.5, 2 2.5, 3 PostgreSQL 9.4.1, the query returns: -2.5, -2 -1.5, -2 -0.5, 0 0.5, 0 1.5, 2 2.5, 2 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs