数字 Numeric
PostgreSQL 资料类型 Data Type 数字 Numeric
Integer 整数
| 类型 |
大小 |
最小值 |
最大值 |
说明 |
| smallint |
2 bytes |
-32,768 |
+32,767 |
- |
| integer |
4 bytes |
-2,147,483,648 |
+2,147,483,647 |
- |
| bigint |
8 bytes |
-9,223,372,036,854,775,808 |
+9,223,372,036,854,775,807 |
- |
| smallserial |
2 bytes |
1 |
+32,767 |
自动增加整数 |
| serial |
4 bytes |
1 |
+2,147,483,647 |
自动增加整数 |
| bigserial |
8 bytes |
1 |
+9,223,372,036,854,775,807 |
自动增加整数 |
Float 浮点数
| 类型 |
大小 |
范围 |
| decimal |
变动(variable) |
小数点前最多 131072 个数字,小数点后最多 16383 个数字 |
| numeric |
变动(variable) |
小数点前最多 131072 个数字,小数点后最多 16383 个数字 |
| real |
4 bytes |
6 位数小数精度 |
| double precision |
8 bytes |
15 位数小数精度 |
| smallserial |
8 bytes |
15 位数小数精度 |
Monetary 货币
| 类型 |
大小 |
最小值 |
最大值 |
说明 |
| money |
8 bytes |
-9,223,372,036,854,775,808 |
+9,223,372,036,854,775,807 |
货币金额 |
Reference