something is corrupting the data
something is corrupting the data
От:
"Elford,Andrew [Ontario]" <Andrew.Elford@ec.gc.ca>
Дата:
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?
Re: [Maybe Spam] something is corrupting the data
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 > >