X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6876F5E46F2 for ; Tue, 31 Aug 2004 08:53:18 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77909-01 for ; Tue, 31 Aug 2004 11:53:07 +0000 (GMT) Received: from trade-india.com (unknown [203.101.29.7]) by svr1.postgresql.org (Postfix) with SMTP id 7B9225E46F3 for ; Tue, 31 Aug 2004 08:53:09 -0300 (ADT) Received: (qmail 21746 invoked from network); 31 Aug 2004 11:46:47 -0000 Received: from valium.trade-india-local.com (HELO ?192.168.0.100?) (192.168.0.100) by system66.trade-india-local.com with SMTP; 31 Aug 2004 11:46:47 -0000 Message-ID: <41346727.8080901@trade-india.com> Date: Tue, 31 Aug 2004 17:25:19 +0530 From: Rajesh Kumar Mallah User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Arbitrary precision arithmatic with pgsql Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/333 X-Sequence-Number: 18830 Hi, The docs says that numeric type supports numbers upto any precision 8.1.2. Arbitrary Precision Numbers The type numeric can store numbers with up to 1000 digits of precision and perform calculations exactly. It is especially recommended for storing monetary amounts and other quantities where exactness is required. However, the numeric type is very slow compared to the floating-point types described in the next section. However tradein_clients=# SELECT cast(2^100 as numeric); +---------------------------------+ | numeric | +---------------------------------+ | 1267650600228230000000000000000 | +---------------------------------+ (1 row) Time: 1036.063 ms Naturally there is a loss of information here. So my question is 1. Does the specs not require pgsql to print a warning or info , will it not be considered silient truncation of data. 2. Is there any way to do such calculation using pgsql, i understand bc is a better tool for it. Warm Regards Rajesh Kumar Mallah. -- regds Mallah. Rajesh Kumar Mallah +---------------------------------------------------+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarketPlace | | http://www.tradeindia.com/ | +---------------------------------------------------+