Re: float output precision questions

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Pedro Miguel Frazao Fernandes Ferreira <pfrazao(at)ualg(dot)pt>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: float output precision questions
Date: 2002-10-29 22:19:05
Message-ID: Pine.LNX.4.44.0210291826420.2006-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pedro Miguel Frazao Fernandes Ferreira writes:

> Is there a way to set query output precision to maximum precision ?
> For the type of application I mentioned this is crucial. People want to
> get the 'same' numbers, from querys or dumps, as they inserted them.

There isn't a way right now, but it's planned to be able to dump
floating-point numbers in some binary form (like printf("%A")) to be able
to restore them exactly. Not sure how that would satisfy the needs of
client interfaces, though.

> Matlab has a toolbox fucntion, claiming maximum precision, to convert
> from its double type (PostgreSQL float8) to string which does a
> sprintf('%25.18g',number).

Do we have some mathematical guarantee that this is sufficient and
necessary? If so, then it might do.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-10-29 22:19:22 Re: string freeze
Previous Message Peter Eisentraut 2002-10-29 22:18:27 Re: Trigger on 'create table' ?