When I tell postgreSQL to show a column as float, I always get as a result "double precision".
Is it the same?
Like Damien quoted from the documentation:
PostgreSQL also supports the SQL-standard notations
floatandfloat(p)for specifying inexact numeric types. Here,pspecifies the minimum acceptable precision in binary digits.
PostgreSQL acceptsfloat(1)tofloat(24)as selecting therealtype, whilefloat(25)tofloat(53)selectdouble precision.
Values ofpoutside the allowed range draw an error.
floatwith no precision specified is taken to meandouble precision.
PostgreSQL, like other databases, supports the SQL standard by supplying an appropriate data type when a certain SQL standard type is requested. Since real or double precision fit the bill here, they are taken instead of creating new redundant types.
The disadvantage is that the data type of a column may read different from what you requested, but as long as it handles your data the way it should, is that a problem?
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