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.

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

1 Answer 1

3

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.

2
  • 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... Commented Feb 6, 2020 at 19:42
  • I just edited the coarsest inaccuracies. Commented Feb 6, 2020 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.