Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 460DD64FDBD for ; Sun, 14 Dec 2008 13:30:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41368-07 for ; Sun, 14 Dec 2008 13:30:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tempest.mainecoon.com (tempest.mainecoon.com [69.12.217.123]) by mail.postgresql.org (Postfix) with ESMTP id EC7E564FCCF for ; Sun, 14 Dec 2008 13:30:06 -0400 (AST) Received: from [10.1.1.2] (fw.boscorama.com [75.101.8.88]) by tempest.mainecoon.com (Postfix) with ESMTPSA id D3EFE6EA0A2; Sun, 14 Dec 2008 09:30:03 -0800 (PST) Message-ID: <49454298.3020202@boscorama.com> Date: Sun, 14 Dec 2008 09:30:00 -0800 From: Bosco Rama User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.18) Gecko/20081030 SeaMonkey/1.1.13 Mnenhy/0.7.4.0 MIME-Version: 1.0 To: Bosco Rama , pgsql-interfaces@postgresql.org Subject: Re: gcc _Decimal types & ecpg References: <4941F4FB.1080902@boscorama.com> <20081214122646.GB30170@feivel.credativ.de> In-Reply-To: <20081214122646.GB30170@feivel.credativ.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/17 X-Sequence-Number: 6834 Hi Michael, Michael Meskes wrote: > On Thu, Dec 11, 2008 at 09:22:03PM -0800, Bosco Rama wrote: >> I was wondering if ecpg from Postgresql 8.3.5 is able to handle the gcc4 _Decimal32, >> _Decimal64 & _Decimal128 intrinsic data types as transparently as the other types? >> Or do they just end up getting treated as simple C float/double? > > To be honest I haven't heard/thought about these datatypes before. Could you > give me a pointer where to find more information? Are these types similar to > our decimal/numeric types? These are the Decimal Floating Point types with storage bit-widths of 32, 64, 128. They are part of the IEEE-754 2008 spec and have been added to the C99 spec as an extension and have been in gcc since early in the 4 series. The GCC docs don't have much on this: But these guys do: I don't know how closely it would match your decimal/numeric types internally but I believe you could specify matching NUMERIC(x,y) declarations for them. > The parser does not recognize these type keywords. So yes, atm they have to be treated > as float/double. I wonder if there will be conversion/cast issues with that? I'll have to look closer to find out. We may just end us storing them as text/varchar. Thanks. Bosco.