The following table shows the various numeric types:
Name |
Comments |
Size |
Range |
smallint |
SQL equivalent: Int2 |
2 bytes |
-32,768 to +32,767. |
integer |
SQL equivalent: Int4 Integer is an alias for INT. |
4 bytes |
-2,147,483,648 to +2,147,483,647. |
bigint |
SQL equivalent: Int8 8 bytes |
8 bytes |
-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807. |
numeric or decimal |
No difference in PostgreSQL |
Variable |
Up to 131,072 digits before the decimal point; up to 16,383 digits after the decimal point. |
real |
Special values: Infinity, Infinity, NaN |
4 bytes |
Platform-dependent, at least six-digit precision. Often, the range is 1E-37 to 1E+37. |
double precision |
Special values: Infinity, ... |