X-Original-To: pgsql-odbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 905799FA38F for ; Tue, 13 Jun 2006 20:52:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 46760-06 for ; Tue, 13 Jun 2006 20:52:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sd.tpf.co.jp (smtp.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 449AA9FA1A8 for ; Tue, 13 Jun 2006 20:52:06 -0300 (ADT) Received: (qmail 17084 invoked from network); 14 Jun 2006 08:52:04 +0900 Received: from unknown (HELO ?100.0.32.254?) (100.0.32.254) by sd2.tpf-fw-c.co.jp with SMTP; 14 Jun 2006 08:52:04 +0900 Message-ID: <448F4F89.3010308@tpf.co.jp> Date: Wed, 14 Jun 2006 08:51:37 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: postgresql.org@tgice.com CC: pgsql-odbc@postgresql.org Subject: Re: float8 auto truncation issue in ODBC v. PGSQL References: <448F11E2.1020504@tgice.com> In-Reply-To: <448F11E2.1020504@tgice.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/89 X-Sequence-Number: 7837 postgresql.org@tgice.com wrote: > Not sure if the ODBC list is the best place for this question, but I've > encountered some strange behavior and was wondering if anyone had an > idea as to what's going on. > > I've got a float8 data type in a column. I have a value '1.0475' > inserted into it. That number cannot of course be perfectly represented > as a float8. > > When I perform a test like this in MSSQL 7, e.g., and select it using > any variety of tools I get this out: > > 1.0475000000000001 > > When I use my own ODBC SQL client to select the same value from my > Postgres 8.0 database, I get the same thing: > > 1.0475000000000001 > > *However*, and here's the troubling part, when I select the exact same > value using psql (and I have reason to believe the same thing is going > on inside pl/pgsql functions), the value that comes out is: > > 1.0475 > > Now, some of you may say, "What's your problem? That's actually the > correct value!" That's true, it is. However, I'm confused as to the > differences between the result I get *from* PG via my ODBC client and > what Postgres shows with it's internal tools. The odbc driver automatically issues *set extra_float_digits to 2* command at the beginning. regards, Hiroshi Inoue