I have a table in ORACLE with a column which has a data type of NUMBER(*,0). As per my understanding it means precision will be 38 since that is the maximum limit of precision and scale value will be 0 which means no numbers will be allowed after decimal point i.e. will store integers?
I have a requirement where I have to create same table in PostgreSQL. Is it possible to write NUMERIC(*,0) in PostgreSQL? If not, what will be PostgreSQL equivalent of NUMBER(*,0)?
Postgres supports arbitrary precision numeric values. The Oracle number type has up to 38 digits of precision. So, the type:
number(*, 0)
is really:
number(38, 0)
The equivalent in Postgres is:
numeric(38)
or:
numeric(38, 0)
However, Postgres supports ridiculously large precisions and scales. So if you specify: numeric
You will be able to represent any number that you are likely to encounter or need in your lifetime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With