数值类型
数值类型由两个字节,4字节和8字节的整数,4字节和8字节的浮点数和可选精度的小数。下表列出了可用的类型。 www.yiibai.com
Name | Storage Size | Description | Range |
---|---|---|---|
int2 | 2 bytes | small-range integer | -32768 to +32767 |
int4 | 4 bytes | typical choice for integer | -2147483648 to +2147483647 |
int8 | 8 bytes | large-range integer | -9223372036854775808 to 9223372036854775807 |
decimal | variable | user-specified precision,exact | up to 131072 digits before the decimal point; up to 16383 digits after the decimal point |
float4 | 4 bytes | variable-precision,inexact | 6 decimal digits precision |
float8 | 8 bytes | variable-precision,inexact | 15 decimal digits precision |
serial2 | 2 bytes | small autoincrementing integer | 1 to 32767 |
serial4 | 4 bytes | autoincrementing integer | 1 to 2147483647 |
serial8 | 8 bytes | large autoincrementing integer | 1 to 9223372036854775807 |