Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 46E061337B50 for ; Wed, 3 Nov 2010 07:13:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 78833-03 for ; Wed, 3 Nov 2010 10:13:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.qbik.com (smtp.qbik.com [210.55.214.35]) by mail.postgresql.org (Postfix) with ESMTP id 54C8F133616B for ; Wed, 3 Nov 2010 07:13:45 -0300 (ADT) Received: From [192.168.1.10] (unverified [219.89.219.89]) by SMTP Server [210.55.214.35] (WinGate SMTP Receiver v7.0.0 (Build 3060)) with SMTP id <0017649059@smtp.qbik.com>; Wed, 3 Nov 2010 23:13:42 +1300 Message-ID: <4CD135D5.1090308@qbik.com> Date: Wed, 03 Nov 2010 23:13:41 +1300 From: Adrien de Croy User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Hiroshi Inoue CC: "pgsql-odbc@postgresql.org" Subject: Re: Various errors in psqlodbc: SQLGetTypeInfo, SQLTables, bigint, and double vs float References: <6B48F83ECA0ABA4F9E360E8E0A1CDFFC35E4AE0E@HALLEY.maeil.pt> <4CD09C7F.9070403@tpf.co.jp> <4CD0D584.30908@qbik.com> <4CD11F17.5050207@tpf.co.jp> In-Reply-To: <4CD11F17.5050207@tpf.co.jp> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/10 X-Sequence-Number: 10495 Hi On 3/11/2010 9:36 p.m., Hiroshi Inoue wrote: > Hi, > > (2010/11/03 12:22), Adrien de Croy wrote: 5. Oddness with double > precision fields. >> >> We had to use double precision fields to store file size information, >> because bigint couldn't do an __int64 (not sure what actual C type this >> really maps to in reality). However when we get the field data back in a >> query, it is reported as type SQL_FLOAT, even though the DB structure in >> the PostgreSQL manager shows it as double precision. Obviously you don't >> want to truncate double to float, so is this just in the driver (some >> type switch case not supported?) > > SQL_FLOAT means double precision type. What means signle precision type > is SQL_REAL. When I tried to store a C double type (8byte floating point) into this field which reported itself as SQL_FLOAT even though it's "double precision", it reported that the thing I was poking in was too big, so I had to fall back to storing it as a C float type. This is using SQLBindParameter. my understanding is SQL_DOUBLE is required. Is that used? It's certainly used by other DBs, such as MySQL, MS SQL server and Access even. Thanks for your reply Regards Adrien > >> Once we worked around all these issues, it seems to be working great. >> I'm a bit concerned about losing precision with double vs float though. >> >> Regards >> >> Adrien > -- Adrien de Croy - WinGate Proxy Server - http://www.wingate.com