Re: SQL float types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL float types
Date: 2000-07-08 00:40:10
Message-ID: 14994.963016810@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane writes:
>>>> float4 => real
>>>> float8 => double precision
>> Not just on your say-so. Arguments please?

> SQL:
> 22)REAL specifies the data type approximate numeric, with implementation-
> defined precision.
> 23)DOUBLE PRECISION specifies the data type approximate numeric,
> with implementation-defined precision that is greater than the
> implementation-defined precision of REAL.
> Notice that there is no "at least" here anywhere.

Good point.

> The REAL data type is not even documented.

It isn't? In that case the compatibility argument isn't as pressing
as I thought. OK, I'm convinced.

> Actually, if you read into the release history it says:
> The following are aliases to existing postgres types:
> float, real -> float4

Actually, "float" without any precision spec defaults to float8 at the
moment, so both parts of this item in the history are wrong.

BTW, are you arguing to change the float->float8 default? I think that
would be a bad idea. Offhand I don't see anything in SQL that mandates
a particular default precision for FLOAT.

regards, tom lane

PS: I seem to recall some unhappiness about the ODBC driver's mappings
between Postgres float types and the ODBC type codes. You might want
to check that while you are at it.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bitmead 2000-07-08 00:55:46 Re: libpq / SQL3
Previous Message Philip Warner 2000-07-08 00:36:40 Re: Re: pg_dump and LOs (another proposal)