More of rant, than a question, but maybe someone would explain — why PostgreSQL migration wiki states that
FLOAT (Oracle) is REAL (Postgres) and DOUBLE is DOUBLE PRECISION
when in PostgreSQL DOUBLE PRECISION
supports 15 significant digits, whereas in Oracle DOUBLE
provides 38 ?!
IMO, this is quite an omission for people planning to migrate their data to PostgreSQL.
Best Answer
The information seems to be inaccurate.
Oracle has only three numeric data types:
NUMBER
: binary coded decimals. Slow, but exact.BINARY_FLOAT
: IEEE single precision floating point number. Fast and quite imprecise.BINARY_DOUBLE
: IEEE double precision floating point number. Fast and less imprecise.You can use
INTEGER
,DOUBLE PRECISION
,REAL
andFLOAT
in Oracle, like the SQL standard demands, but you will always get aNUMBER
(FLOAT
isNUMBER
, only the precision is given in binary rather than in decimal digits).PostgreSQL has more numeric data types:
numeric
(ordecimal
, which is just another name): binary coded decimals. Exact, but very slow.This corresponds to Oracle's
NUMBER
.real
(orfloat4
): the platform's native single precision floating point numbers, usually IEEEThis corresponds to Oracle's
BINARY_FLOAT
.double precision
(orfloat8
): the platform's native double precision floating point numbers, usually IEEEThis corresponds to Oracle's
BINARY_DOUBLE
.integer
(orint4
): four-byte integersOracle has nothing like that.
bigint
(orint8
): eight-byte integersOracle has nothing like that.