Thanks for answer, but in documentation I found that Numeric can be without scale and precision defined:

"Specifying
NUMERICwithout any precision or scale creates a column in which numeric values of any precision and scale can be stored, up to the implementation limit on precision. A column of this kind will not coerce input values to any particular scale, whereas numeric columns with a declared scale will coerce input values to that scale. (The SQL standard requires a default scale of 0, i.e., coercion to integer precision. We find this a bit useless. If you're concerned about portability, always specify the precision and scale explicitly.) "

Talking about float: "If you require exact storage and calculations (such as for monetary amounts), use the numeric type instead. "

So, it seems that numeric without parameters (precision, scale) behave similar to float, but is much exact. Am I right or I missunderstood?

Thanks,

Zlatko



----- Original Message ----- From: "Tony Caduto" <[EMAIL PROTECTED]>
To: "Zlatko Matić" <[EMAIL PROTECTED]>
Sent: Saturday, January 21, 2006 5:15 PM
Subject: Re: [GENERAL] numeric data type?


Zlatko Matić wrote:
Is "numeric" data type good choice for a field that would store integer values in most cases, but sometimes decimal values as well?
Thanks,
 Zlatko

I think you would be better off with a float.
numeric has to have a scale set to it, while float4 or float8 does not.

--
Tony Caduto
AM Software Design
Home of PG Lightning Admin for Postgresql
http://www.amsoftwaredesign.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to