Re: SQL float types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SQL float types
Date
Msg-id 14994.963016810@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQL float types  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.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.


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: Re: pg_dump and LOs (another proposal)
Next
From: Chris Bitmead
Date:
Subject: Re: libpq / SQL3