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 E96BC9FA13E for ; Tue, 13 Jun 2006 17:14:58 -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 20509-09 for ; Tue, 13 Jun 2006 17:14:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 19B4B9F9316 for ; Tue, 13 Jun 2006 17:14:50 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k5DKEnNn010153; Tue, 13 Jun 2006 16:14:49 -0400 (EDT) To: postgresql.org@tgice.com cc: pgsql-odbc@postgresql.org Subject: Re: float8 auto truncation issue in ODBC v. PGSQL In-reply-to: <448F11E2.1020504@tgice.com> References: <448F11E2.1020504@tgice.com> Comments: In-reply-to postgresql.org@tgice.com message dated "Tue, 13 Jun 2006 14:28:34 -0500" Date: Tue, 13 Jun 2006 16:14:49 -0400 Message-ID: <10152.1150229689@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/86 X-Sequence-Number: 7834 postgresql.org@tgice.com writes: > 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 By default, the float8 output routine prints a digit or so less than it could, precisely to avoid that sort of unsightly result. You can fool with float_extra_digits (I think that's the right name, check the docs) if you need to adjust this behavior. This would only matter within a plpgsql function if you are doing something that forces the binary value to be converted to text. Which, if you're doing tense float computation, you probably don't want to have happen at all. regards, tom lane