abd*_*003 15 postgresql integer primary-key
我正在使用postgresql,并想知道有多大
id INTEGER PRIMARY KEY
Run Code Online (Sandbox Code Playgroud)
可以得到比较
id SERIAL PRIMARY KEY
Run Code Online (Sandbox Code Playgroud)
在java中,a int是4个字节(32位),因此它可以达到2,147,483,647.在postgresql中是这种情况吗?如果是这样意味着我不能超过2,147,483,647行?
Har*_* CO 38
这是PostgreSQL的一个方便的图表:
Name Storage Size Description Range
smallint 2 bytes small-range integer -32768 to +32767
integer 4 bytes usual choice for integer -2147483648 to +2147483647
bigint 8 bytes large-range integer -9223372036854775808 to 9223372036854775807
serial 4 bytes autoincrementing integer 1 to 2147483647
bigserial 8 bytes large autoincrementing integer 1 to 9223372036854775807
Run Code Online (Sandbox Code Playgroud)
您的评估是正确的,如果您使用的数据类型不足,则您将使用唯一ID.
| 归档时间: |
|
| 查看次数: |
17309 次 |
| 最近记录: |