0

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.

  • Can you add the url to "PostgreSQL migration wiki"? – Lennart Feb 6 at 12:08
  • 1
    IEEE numbers are only good for 6 digits. Use actual NUMBERor your design could be flawed. – Michael Kutz Feb 6 at 12:09
  • 1
    @Lennart added. – Victor Sorokin Feb 6 at 12:12
  • If you need the precision, use numeric in Postgres – a_horse_with_no_name Feb 6 at 12:30
2

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 and FLOAT in Oracle, like the SQL standard demands, but you will always get a NUMBER (FLOAT is NUMBER, only the precision is given in binary rather than in decimal digits).


PostgreSQL has more numeric data types:

  • numeric (or decimal, which is just another name): binary coded decimals. Exact, but very slow.

    This corresponds to Oracle's NUMBER.

  • real (or float4): the platform's native single precision floating point numbers, usually IEEE

    This corresponds to Oracle's BINARY_FLOAT.

  • double precision (or float8): the platform's native double precision floating point numbers, usually IEEE

    This corresponds to Oracle's BINARY_DOUBLE.

  • integer (or int4): four-byte integers

    Oracle has nothing like that.

  • bigint (or int8): eight-byte integers

    Oracle has nothing like that.

| improve this answer | |
  • I read the wiki article it goes back to 2008, its a copy from another article that predates 2008. Allot of the articles information is just out of date its had a few minor edits over the years. It needs to be overhauled... – zsheep Feb 6 at 19:42
  • I just edited the coarsest inaccuracies. – Laurenz Albe Feb 6 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.