Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YaxL8-0001cx-IP for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Mar 2015 02:16:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YaxL7-0003q0-Ta for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Mar 2015 02:16:09 +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 1YaxL6-0003pt-Pr for pgsql-bugs@postgresql.org; Thu, 26 Mar 2015 02:16:08 +0000 Received: from mail-qg0-x236.google.com ([2607:f8b0:400d:c04::236]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YaxKz-0005CD-GM for pgsql-bugs@postgresql.org; Thu, 26 Mar 2015 02:16:06 +0000 Received: by qgfa8 with SMTP id a8so71723517qgf.0 for ; Wed, 25 Mar 2015 19:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FhWLeNrexBADVIkJRyoZLFIjMJ1+GlxYBsKwktAsATg=; b=l0vm6fSC8wENtO4emUVZp/Ybvk+YOgkKaAGUgaiDXOiRfJ7Kd/XjoBmNXWJQtEmza+ gca73xwWXwONwVZMwb6NvipPPE31elf5+FPpTfl8atXpld4mVUzO+XbqCTZuUg/fNV2l o2sZYZDCL4BjMCP6eQT4kx2Y/boxGn/TNmgytiGECel4cYb5CN64hYE7g0RQwCsP7BX4 mRCenaYeLOL6Ve+R8P9zQu40Iq2B3XVfwBMOh04wfwBry3MUH6+EtuCrBplPUiNuOpj1 RNc10uIMNZGPVJBsOWSoI9s4i7hynAdRyQgOM+tYc+sUicA+TjOafKemI7Ua1wXmA6jr QB+g== MIME-Version: 1.0 X-Received: by 10.55.55.4 with SMTP id e4mr24593091qka.97.1427336159940; Wed, 25 Mar 2015 19:15:59 -0700 (PDT) Received: by 10.140.86.18 with HTTP; Wed, 25 Mar 2015 19:15:59 -0700 (PDT) In-Reply-To: <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> <87h9t84ig5.fsf@news-spur.riddles.org.uk> Date: Thu, 26 Mar 2015 11:15:59 +0900 Message-ID: Subject: Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version From: Michael Paquier To: Andrew Gierth Cc: Tom Lane , Pedro Gimeno , rschaaf@commoninf.com, pgsql-bugs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.7 (--) 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 On Thu, Mar 26, 2015 at 11:12 AM, Andrew Gierth wrote: >>>>>> "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. OK, thanks for the reminder... I forgot this case. -- Michael -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs