Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YaxHW-0001Ut-1f for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Mar 2015 02:12:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YaxHV-00034T-HB for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Mar 2015 02:12:25 +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 1YaxHU-00034K-Ee for pgsql-bugs@postgresql.org; Thu, 26 Mar 2015 02:12:24 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YaxHQ-00056k-Lb for pgsql-bugs@postgresql.org; Thu, 26 Mar 2015 02:12:22 +0000 Received: from localhost ([127.0.0.1]:33275 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YaxHM-000K0m-Ba; Thu, 26 Mar 2015 02:12:16 +0000 From: Andrew Gierth To: Michael Paquier Cc: Tom Lane , Pedro Gimeno , rschaaf@commoninf.com, pgsql-bugs@postgresql.org Subject: Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version In-Reply-To: (Michael Paquier's message of "Thu, 26 Mar 2015 10:27:54 +0900") Message-ID: <87h9t84ig5.fsf@news-spur.riddles.org.uk> References: <20150320194337.2573.72944@wrigleys.postgresql.org> <32478.1427122083@sss.pgh.pa.us> <26862.1427166720@sss.pgh.pa.us> <13096.1427204266@sss.pgh.pa.us> <55121967.90308@personal.formauri.es> <55129971.2070208@personal.formauri.es> <3736.1427294258@sss.pgh.pa.us> <5512E0AF.9050103@personal.formauri.es> <5512F2C0.9080007@personal.formauri.es> <8192.1427306273@sss.pgh.pa.us> <5512FE17.6020702@personal.formauri.es> <22366.1427313454@sss.pgh.pa.us> <87lhik4o45.fsf@news-spur.riddles.org.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) Date: Thu, 26 Mar 2015 02:12:16 +0000 MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -1.9 (-) 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 >>>>> "Michael" == Michael Paquier writes: Michael> Indeed... Michael> =# select column1 AS double_value, cast(column1 AS INT) AS Michael> int_value The complication for numeric is that there's also the case of round(x,n) and casting to numeric(m,n) to consider. -- Andrew (irc:RhodiumToad) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs