What happens when DB engine runs out of numbers to use for primary keys?

前端 未结 10 1633
感情败类
感情败类 2021-01-18 10:59

Since DBs do not reuse numbers of deleted records it is possible to run out of numbers, especially if you pick not really a big integer type for this column.
What would

10条回答
  •  不知归路
    2021-01-18 11:16

    Yes it is possible: if you only allow for 2 digit numbers you can only have IDs up to 99, and so on. Inserts would fail once the limit was reached. It is a matter of common sense to choose an appropriate size.

提交回复
热议问题