Re: Re: [Oledb-dev] double precision error with pg linux server, but not with windows pg server

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shachar Shemesh <shachar(at)shemesh(dot)biz>
Cc: Julian Heeb <heebj2000(at)yahoo(dot)de>, oledb-devel(at)pgfoundry(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [Oledb-dev] double precision error with pg linux server, but not with windows pg server
Date: 2007-05-19 19:25:01
Message-ID: 15566.1179602701@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Shachar Shemesh <shachar(at)shemesh(dot)biz> writes:
> I'll reiterate - the problem is not that PG is exporting the internal
> ARM FP format. The problem is that the server is exporting the internal
> ARM FP format when the server is ARM, and the IEEE format when the
> server is Intel. It's not the format, it's the inconsistency.

This is not a bug, it's intentional. While IEEE-spec floats are
reasonably interchangeable these days (modulo the endianness issue),
other FP formats tend to have different ranges, special cases, etc.
If we try to force them to IEEE spec we may have problems with overflow,
loss of precision, who knows what.

> Like I said elsewhere, I'm willing to write a patch to "pq_sendfloat8"
> (and probably "pq_getmsgfloat8" too) to make sure it does the conversion
> on ARM platforms. Hell, I think I can even write it portable enough so
> that it will work on all non-IEEE platforms

Really? Will it be faster and more reliable than conversion to text?
(In this context "reliable" means "can reproduce the original datum
exactly when transmitted back".)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shachar Shemesh 2007-05-19 20:16:27 Re: Re: [Oledb-dev] double precision error with pg linux server, but not with windows pg server
Previous Message Bruce Momjian 2007-05-19 19:13:05 Re: Maintaining cluster order on insert