News for hackers. Stuff that matters.
Re:PostgreSQL and UUID as Primary Key by mixmastamyk on Saturday July 06, 2024 @03:41AM (#40888812)
Postgres doesn't support unsigned ints last I looked, so it's actually a ~2 billion limit.

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.

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.