Re:PostgreSQL and UUID as Primary Key
by blackenedgem on Saturday July 06, 2024 @01:35PM
(#40891859)
You can start the sequence at -2b, or wrap it around when it gets close to the signed limit. Hopefully you haven't depended on it not wrapping around by that point.
For queue tables you can even use `CYCLE` to do that automatically.
Secondly, it's not XXXk rows currently-you have to consider the complete lifetime of the table. When rows are deleted/created and how often.
So what you've said is true, but the set of appropriateness for smallint is a much smaller than expected.