Posts

Showing posts with the label double

Numeric Types

Image
Introduction Postgres is famous for being a feature-rich database, supporting a large list of data types that can be divided into several groups with distinct functions. First, we will explore a very commonly used group, Numeric Types, which includes the following data types: smallint : 2 bytes, (+/-) 32,767 integer or int : 4 bytes, (+/-) 2,147,483,646 (~2.1 billion) bigint : 8 bytes, (+/-) 9,223,372,036,854,775,807 (~9.22 million billion) numeric : 10 bytes, (+/-) 10^131071 Used to store fixed-precision decimal numbers, never suffering from implicit rounding errors Highly suitable for financial, monetary and accounting data Flexible size Up to 131,072 digits before the decimal point and 16,383 digits after the decimal point 100% absolute accuracy based on the numeric(Precision, Scale) configuration Precision : The total count of digits that can be stored (including digits both before and after the decimal point, excluding negative/positive signs or decimal points), ranging from ...