pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Campbell <greg.campbell@us.michelin.com>
To: ElfordAndrew [Ontario] <Andrew.Elford@ec.gc.ca>
Cc: pgsql-odbc@postgresql.org
Subject: Re: [Maybe Spam] something is corrupting the data
Date: Tue, 15 Mar 2005 16:29:17 -0500
Message-ID: <423753AD.6080701@us.michelin.com> (raw)
In-Reply-To: <9B09D75DF5B3494BA06E6FE478CE9CC17B5E16@mgtserver3.ontario.int.ec.gc.ca>
References: <9B09D75DF5B3494BA06E6FE478CE9CC17B5E16@mgtserver3.ontario.int.ec.gc.ca>

Don't know that I would call that corruption as much as a difference in 
precision past about the 5th decimal -- of course all floating point 
numbers are actually stored as some form  like 0.2546E+2.

If I were using Access, I'd link to the tables and check the data type 
Access thinks it has,..single (4 byte floating point) or double (8 byte 
floating point). If pressed, I would then turn on ODBC debugging, and 
run some queries to see the exact data passed back and forth between 
hither and yon (client and server).

If pressed still I would explore the arcane world of floating point data 
storage and representation (G type, E types, and F types) that I haven't 
paid much attention to since I programmed in Fortran.

Of course, in the real world, since I don't work in a bank or NASA, I 
try  not to get pressed that far.



Elford,Andrew [Ontario] wrote:

>Server (on Gentoo linux): postgresql-7.4.7
>Windows client: psqlodbc-07.03.0200
>
>
>I get perfect results when I use pgAdmin or directly on the console, but
>when I use Excel or Access through ODBC, I get corrupted numbers (using
>the same SQL command).  The data corruption is consistent (same wrong
>number every time).  The data type for all fields is float4.  I've tried
>newer snapshot versions of psqlodbc and different clients, no luck.
>This also occurred with postgresql 7.3 on our old RH box... 
>
>Correct:
>2.5246,2.1749,229.04,30.148,0.92686,41.7
>
>Excel/Access results:
>2.5246,2.1749001,229.03999,30.148001,0.92685997,41.700001	
>
>Any suggestions?
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>  
>

Attachments:

greg.campbell.vcf (text/x-vcard, 281B) download begin:vcard fn:Greg Campbell n:Campbell;Greg org:Michelin North America;ENG-IT adr;dom:;;2420 Two Notch Road;Lexington;SC;29071 email;internet:greg.campbell@us.michelin.com title:Systems Engineer tel;work:803-951-5561 tel;fax:803-951-5531 x-mozilla-html:FALSE version:2.1 end:vcard

view thread (2+ messages)

Message-ID: <423753AD.6080701@us.michelin.com>
Permalink:  ../423753AD.6080701@us.michelin.com/
Also on:    postgresql.org/message-id/423753AD.6080701@us.michelin.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: greg.campbell@us.michelin.com, Andrew.Elford@ec.gc.ca
  Subject: Re: [Maybe Spam] something is corrupting the data
  In-Reply-To: <423753AD.6080701@us.michelin.com>
  References: <9B09D75DF5B3494BA06E6FE478CE9CC17B5E16@mgtserver3.ontario.int.ec.gc.ca> <423753AD.6080701@us.michelin.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox