Resolved: float and double
I don't quite understand the difference between float and double. I come across float4 and float8 and I really don't understand when to use which?
Thanks for reaching out.
The choice between using FLOAT() and DOUBLE() is about how many bytes will be used to store the data from the given field. FLOAT() requires 4 bytes (i.e., you'd opt for FLOAT() if 4 bytes would suffice), and DOUBLE() will require 8 bytes. In other words, more bytes used in the memory, the more symbols you can use to represent the numeric values from that field.
A synonym for float4 is real. Synonyms for float are float8 and double precision.
Hope this helps.