Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpDfn-0007l5-RN for pgsql-docs@arkaria.postgresql.org; Thu, 31 Jan 2019 14:50:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpDfm-0003U4-J4 for pgsql-docs@arkaria.postgresql.org; Thu, 31 Jan 2019 14:50:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpDfP-0001Vh-B5 for pgsql-docs@lists.postgresql.org; Thu, 31 Jan 2019 14:50:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpDfM-0000sU-Pa for pgsql-docs@lists.postgresql.org; Thu, 31 Jan 2019 14:50:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x0VEo4OG002263; Thu, 31 Jan 2019 09:50:04 -0500 From: Tom Lane To: bhagyashreesalunkhe25@gmail.com cc: pgsql-docs@lists.postgresql.org Subject: Re: Round(DP Or numeric ) returns integer In-reply-to: <154892491574.1302.16555048036514019478@wrigleys.postgresql.org> References: <154892491574.1302.16555048036514019478@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Thu, 31 Jan 2019 08:55:15 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2261.1548946204.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 31 Jan 2019 09:50:04 -0500 Message-ID: <2262.1548946204@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Doc comments form writes: > 1) The function round( dp or numeric ) always has return type integer not > same as our parameter is. > 2) The function round( dp or numeric, sĀ int ) returns the same type as our > parameter is not an integer type. Huh? postgres=# \df round List of functions Schema | Name | Result data type | Argument data types | Type ------------+-------+------------------+---------------------+------ pg_catalog | round | double precision | double precision | func pg_catalog | round | numeric | numeric | func pg_catalog | round | numeric | numeric, integer | func (3 rows) The description in the docs matches reality AFAICS. regards, tom lane